Skip to content

Commit 486f70d

Browse files
Adding WORKER_CONNECTIONS, defaulting to 1024 (#27)
* Adding WORKER_CONNECTIONS, defaulting to 1024 * Removed conditional from setting worker connections --------- Co-authored-by: Signal Linden <[email protected]>
1 parent 7f06282 commit 486f70d

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

Dockerfile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
############
2-
# Base
2+
# Base
33
############
44
FROM alpine:3 AS base
55
RUN apk add --no-cache \
@@ -15,6 +15,7 @@ ENV HEALTHCHECK_PATH="/lb-status/"
1515
ENV STATIC_LOCATIONS=
1616
ENV NO_ACCESS_LOGS=0
1717
ENV LOG_ONLY_5XX=0
18+
ENV WORKER_CONNECTIONS=1024
1819
EXPOSE 80
1920
STOPSIGNAL SIGQUIT
2021
ENTRYPOINT ["/docker-entrypoint.sh"]
@@ -35,7 +36,7 @@ WORKDIR /test_uwsgi
3536
RUN /test_uwsgi/test.sh
3637

3738
############
38-
# Final
39+
# Final
3940
############
4041
FROM base
4142
LABEL "com.datadoghq.ad.check_names"='["nginx"]'

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ environments such as AWS ECS.
66

77
## Features
88

9-
- Structured logs with a lot more data than the standard nginx access format.
9+
- Structured logs with a lot more data than the standard nginx access format.
1010
- [uWSGI][] support
1111
- Support for hosting static assets mounted from another container
1212

@@ -27,6 +27,7 @@ Pair nginx-proxy with your favorite upstream server (wsgi, uwsgi, asgi, et al.)
2727
| `HEALTHCHECK_PATH` | nginx-proxy disables healthcheck path access logs, you can configure the path here | Yes | /lb-status/ | |
2828
| `NO_ACCESS_LOGS` | disable access logs completely | No | 0 | 1 |
2929
| `LOG_ONLY_5XX` | only log 5XX HTTP status access events | No | 0 | 1 |
30+
| `WORKER_CONNECTIONS` | Set the number of allowed worker connections | No | 1024 | 2048 |
3031

3132
### Hosting Static Assets
3233

@@ -79,7 +80,7 @@ Notable differences from the official [nginx container][]
7980

8081
- [gomplate][] is used to render nginx configuration templates so that image startup
8182
is aborted if a template variable is missing. This is an improvement over the
82-
official image, which uses `envsubst`.
83+
official image, which uses `envsubst`.
8384
- alpine's official nginx package is used in order to ensure compatibility with
8485
distro-provided nginx modules. This is another enhancement, as the official
8586
image cannot be used with alpine's nginx modules.

src/etc/nginx/nginx.conf.template

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ pid /var/run/nginx.pid;
88
load_module /usr/lib/nginx/modules/ngx_http_headers_more_filter_module.so;
99

1010
events {
11-
worker_connections 1024;
11+
worker_connections {{ .Env.WORKER_CONNECTIONS }};
1212
use epoll;
1313
}
1414

0 commit comments

Comments
 (0)