Skip to content

Commit 0f58c81

Browse files
authored
Merge pull request #24 from secondlife/signal/no-access-logs
Add NO_ACCESS_LOGS option
2 parents 8f5789c + 4e4d409 commit 0f58c81

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed

Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ ENV PROXY_UWSGI=0
1313
ENV LISTEN_PORT=80
1414
ENV HEALTHCHECK_PATH="/lb-status/"
1515
ENV STATIC_LOCATIONS=
16+
ENV NO_ACCESS_LOGS=0
1617
EXPOSE 80
1718
STOPSIGNAL SIGQUIT
1819
ENTRYPOINT ["/docker-entrypoint.sh"]

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ Pair nginx-proxy with your favorite upstream server (wsgi, uwsgi, asgi, et al.)
2525
| `PROXY_UWSGI` | Whether to use native uwsgi support | No | 0 | 1 |
2626
| `KEEPALIVE_TIMEOUT` | What value to set HTTP keepalive (This should be higher than your ELB's timeout) | Yes | 65 | |
2727
| `HEALTHCHECK_PATH` | nginx-proxy disables healthcheck path access logs, you can configure the path here | Yes | /lb-status/ | |
28+
| `NO_ACCESS_LOGS` | disable access logs completely | No | 0 | 1 |
2829

2930
### Hosting Static Assets
3031

src/etc/nginx/conf.d/default.conf.template

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ server {
3030
{{ end }}
3131
}
3232

33+
{{ if (eq .Env.NO_ACCESS_LOGS "1" ) }}
34+
access_log off;
35+
{{ else }}
3336
location {{ .Env.HEALTHCHECK_PATH }} {
3437
access_log off;
3538
{{ if (eq .Env.PROXY_UWSGI "1") }}
@@ -38,6 +41,7 @@ server {
3841
include /etc/nginx/includes/proxy.conf;
3942
{{ end }}
4043
}
44+
{{ end }}
4145

4246
{{ if .Env.STATIC_LOCATIONS }}
4347
{{ range (.Env.STATIC_LOCATIONS | strings.Split "," )}}

0 commit comments

Comments
 (0)