diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..48c7560 --- /dev/null +++ b/.dockerignore @@ -0,0 +1 @@ +.git/* diff --git a/README.md b/README.md index 4617c96..f47cec4 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,7 @@ Variable | Example | Description `SERVER_SENDFILE` | `SERVER_SENDFILE=off` | Allows runtime to specify value of nginx's `sendfile` (default, on) `SERVER_KEEPALIVE` | `SERVER_KEEPALIVE=30` | Define HTTP 1.1's keepalive timeout `SERVER_WORKER_CONNECTIONS` | `SERVER_WORKER_CONNECTIONS=2048` | Sets up the number of connections for worker processes +`SERVER_LOG_MINIMAL` | `SERVER_LOG_MINIMAL=1` | Minimize the logging format, appropriate for development environments ### Runtime Commands diff --git a/container/root/etc/nginx/nginx.conf b/container/root/etc/nginx/nginx.conf index 72d7637..6674c42 100644 --- a/container/root/etc/nginx/nginx.conf +++ b/container/root/etc/nginx/nginx.conf @@ -26,6 +26,8 @@ http { '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for" NGINX_SERVER'; + log_format minimal '$request_method $request_uri $status'; + error_log /dev/stdout info; access_log /dev/stdout main; diff --git a/container/root/run.d/10-nginx.sh b/container/root/run.d/10-nginx.sh index 664e629..52b7044 100755 --- a/container/root/run.d/10-nginx.sh +++ b/container/root/run.d/10-nginx.sh @@ -44,3 +44,11 @@ then echo "[nginx] setting worker connection limit ${SERVER_WORKER_CONNECTIONS}" sed -i "s/\worker_connections .*;/worker_connections ${SERVER_WORKER_CONNECTIONS};/" $CONF_NGINX_SERVER fi + +if [[ $SERVER_LOG_MINIMAL ]] +then + echo "[nginx] enabling minimal logging" + # Uncomments all gzip handling options + sed -i "s/access_log \/dev\/stdout .*;/access_log \/dev\/stdout minimal;/" $CONF_NGINX_SERVER +fi +