Skip to content

Adding WORKER_CONNECTIONS, defaulting to 1024 #27

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
############
# Base
# Base
############
FROM alpine:3 AS base
RUN apk add --no-cache \
Expand All @@ -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"]
Expand All @@ -35,7 +36,7 @@ WORKDIR /test_uwsgi
RUN /test_uwsgi/test.sh

############
# Final
# Final
############
FROM base
LABEL "com.datadoghq.ad.check_names"='["nginx"]'
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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

Expand Down Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion src/etc/nginx/nginx.conf.template
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down