Skip to content

Commit

Permalink
Merge pull request #24 from devilbox/release-0.29
Browse files Browse the repository at this point in the history
Via Header, client_max_body_size and worker_processes
  • Loading branch information
cytopia authored Mar 3, 2019
2 parents 0f472d4 + 60f43ef commit 0859d39
Show file tree
Hide file tree
Showing 3 changed files with 93 additions and 11 deletions.
14 changes: 6 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ LABEL \
vendor="devilbox" \
license="MIT"


###
### Build arguments
###
Expand Down Expand Up @@ -34,10 +35,8 @@ ENV HTTPD_RELOAD="nginx -s stop"


###
### Installation
### Install required packages
###

# required packages
RUN set -x \
&& apt-get update \
&& apt-get install --no-install-recommends --no-install-suggests -y \
Expand Down Expand Up @@ -67,12 +66,10 @@ RUN set -x \
${BUILD_DEPS} \
&& rm -rf /var/lib/apt/lists/*

# Add custom config directive to httpd server
RUN set -x \
&& sed -i'' 's|^\s*include.*conf\.d/.*| include /etc/httpd-custom.d/*.conf;\n include /etc/httpd/conf.d/*.conf;\n include /etc/httpd/vhost.d/*.conf;\n|g' /etc/nginx/nginx.conf \
&& echo "daemon off;" >> /etc/nginx/nginx.conf

# create directories
###
### Create directories
###
RUN set -x \
&& mkdir -p /etc/httpd-custom.d \
&& mkdir -p /etc/httpd/conf.d \
Expand All @@ -86,6 +83,7 @@ RUN set -x \
###
### Copy files
###
COPY ./data/nginx/nginx.conf /etc/nginx/nginx.conf
COPY ./data/vhost-gen/main.yml /etc/vhost-gen/main.yml
COPY ./data/vhost-gen/mass.yml /etc/vhost-gen/mass.yml
COPY ./data/vhost-gen/templates-main /etc/vhost-gen/templates-main
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -245,13 +245,13 @@ $ docker run -d \

#### 4. Ultimate pre-configured docker-compose setup

Have a look at the **[devilbox](https://github.com/cytopia/devilbox)** for a fully-customizable docker-compose variant.
Have a look at the **[Devilbox](https://github.com/cytopia/devilbox)** for a fully-customizable docker-compose variant.

It offers pre-configured mass virtual hosts and an intranet.

It allows any of the following combinations:

* PHP 5.2, 5.3, 5.4, PHP 5.5, PHP 5.6, PHP 7.0, PHP 7.1, 7.2, 7.3 and 7.4
* PHP 5.2, PHP 5.3, PHP 5.4, PHP 5.5, PHP 5.6, PHP 7.0, PHP 7.1, PHP 7.2, PHP 7.3, PHP 7.4 and PHP 8.0
* MySQL 5.5, MySQL 5.6, MySQL 5.7, MariaDB 5 and MariaDB 10
* Apache 2.2, Apache 2.4, Nginx stable and Nginx mainline
* And more to come...
Expand All @@ -260,5 +260,5 @@ It allows any of the following combinations:
## Version

```
nginx version: nginx/1.14.2
nginx version: nginx/1.14.2
```
84 changes: 84 additions & 0 deletions data/nginx/nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
# =================================================================================================
# MAIN SETTINGS
# =================================================================================================

worker_processes auto;

user nginx;
daemon off;

error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;

events {
worker_connections 1024;
}


# =================================================================================================
# HTTPS SETTINGS
# =================================================================================================

http {

# -------------------------------------------------------------------------------
# NGINX DEFAULTS
# -------------------------------------------------------------------------------

include /etc/nginx/mime.types;
default_type application/octet-stream;

log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';

access_log /var/log/nginx/access.log main;


# -------------------------------------------------------------------------------
# NGINX HEADER
# -------------------------------------------------------------------------------

# Set valid Via header: <PROTOCOL_VERSION> <HOSTNAME> (<SERVER>/<SERVER_VERSION>)
map $server_protocol $my_proto {
"~^HTTP\/(?<version>[.0-9]+)$" $version;
default $server_protocol;
}
add_header Via '$my_proto $hostname (nginx/$nginx_version)' always;


# -------------------------------------------------------------------------------
# NGINX PERFORMANCE
# -------------------------------------------------------------------------------

sendfile on;
#tcp_nopush on;
#aio on;
#gzip on;


# -------------------------------------------------------------------------------
# BUFFER SIZES
# -------------------------------------------------------------------------------

# The maximum allowed size for a client request. If the maximum size is exceeded,
# then Nginx will spit out a 413 error or Request Entity Too Large.
# Setting size to 0 disables checking of client request body size.
client_max_body_size 0;


# -------------------------------------------------------------------------------
# TIMEOUTS
# -------------------------------------------------------------------------------

keepalive_timeout 65;


# -------------------------------------------------------------------------------
# INCLUDES
# -------------------------------------------------------------------------------

include /etc/httpd-custom.d/*.conf;
include /etc/httpd/conf.d/*.conf;
include /etc/httpd/vhost.d/*.conf;
}

0 comments on commit 0859d39

Please sign in to comment.