diff --git a/Dockerfile b/Dockerfile index 82c724a..c3e9f31 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ ############ -# Base +# Base ############ FROM alpine:3 AS base RUN apk add --no-cache \ @@ -15,6 +15,7 @@ ENV HEALTHCHECK_PATH="/lb-status/" ENV STATIC_LOCATIONS= ENV NO_ACCESS_LOGS=0 ENV LOG_ONLY_5XX=0 +ENV WORKER_CONNECTIONS=1024 EXPOSE 80 STOPSIGNAL SIGQUIT ENTRYPOINT ["/docker-entrypoint.sh"] @@ -35,7 +36,7 @@ WORKDIR /test_uwsgi RUN /test_uwsgi/test.sh ############ -# Final +# Final ############ FROM base LABEL "com.datadoghq.ad.check_names"='["nginx"]' diff --git a/README.md b/README.md index 5310e15..e8de132 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ environments such as AWS ECS. ## Features -- Structured logs with a lot more data than the standard nginx access format. +- Structured logs with a lot more data than the standard nginx access format. - [uWSGI][] support - Support for hosting static assets mounted from another container @@ -27,6 +27,7 @@ Pair nginx-proxy with your favorite upstream server (wsgi, uwsgi, asgi, et al.) | `HEALTHCHECK_PATH` | nginx-proxy disables healthcheck path access logs, you can configure the path here | Yes | /lb-status/ | | | `NO_ACCESS_LOGS` | disable access logs completely | No | 0 | 1 | | `LOG_ONLY_5XX` | only log 5XX HTTP status access events | No | 0 | 1 | +| `WORKER_CONNECTIONS` | Set the number of allowed worker connections | No | 1024 | 2048 | ### Hosting Static Assets @@ -79,7 +80,7 @@ Notable differences from the official [nginx container][] - [gomplate][] is used to render nginx configuration templates so that image startup is aborted if a template variable is missing. This is an improvement over the - official image, which uses `envsubst`. + official image, which uses `envsubst`. - alpine's official nginx package is used in order to ensure compatibility with distro-provided nginx modules. This is another enhancement, as the official image cannot be used with alpine's nginx modules. diff --git a/src/etc/nginx/nginx.conf.template b/src/etc/nginx/nginx.conf.template index 9848865..a7889b6 100644 --- a/src/etc/nginx/nginx.conf.template +++ b/src/etc/nginx/nginx.conf.template @@ -8,7 +8,7 @@ pid /var/run/nginx.pid; load_module /usr/lib/nginx/modules/ngx_http_headers_more_filter_module.so; events { - worker_connections 1024; + worker_connections {{ .Env.WORKER_CONNECTIONS }}; use epoll; }