Skip to content

Commit 62ff3b9

Browse files
author
ajaumet
committed
fix the values reference in nginx config
1 parent 2384142 commit 62ff3b9

File tree

3 files changed

+10
-0
lines changed

3 files changed

+10
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -494,6 +494,7 @@ Kubernetes: `^1.19.0-0`
494494
| nginx.​config.​mainSnippet | string | `""` | arbitrary snippet to inject in the top section of the nginx config |
495495
| nginx.​config.​serverSnippet | string | `""` | arbitrary snippet to inject in the server { } section of the nginx config |
496496
| nginx.​config.​setHeaders | object | `{}` | |
497+
| nginx.​config.​verboseLogging | bool | `true` | Enables all access logs from nginx, otherwise ignores 2XX and 3XX status codes |
497498
| nginx.​containerSecurityContext.​enabled | bool | `true` | |
498499
| nginx.​containerSecurityContext.​readOnlyRootFilesystem | bool | `false` | |
499500
| nginx.​enabled | bool | `true` | |

templates/nginx/nginx-config.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,17 @@ data:
2828
log_format main '$remote_addr - $remote_user [$time_local] $status '
2929
'"$request" $body_bytes_sent "$http_referer" '
3030
'"$http_user_agent" "$http_x_forwarded_for" $http_x_scope_orgid';
31+
3132
{{- if .Values.nginx.config.verboseLogging }}
3233
access_log /dev/stderr main;
34+
{{- else }}
35+
map $status $loggable {
36+
~^[23] 0;
37+
default 1;
38+
}
39+
access_log /dev/stderr main if=$loggable;
3340
{{- end }}
41+
3442
sendfile on;
3543
tcp_nopush on;
3644
resolver {{ default (printf "kube-dns.kube-system.svc.%s" .Values.clusterDomain ) .Values.nginx.config.dnsResolver }}{{- if .Values.nginx.config.dnsTTL }} valid={{ .Values.nginx.config.dnsTTL }}{{- end }};

values.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1278,6 +1278,7 @@ nginx:
12781278
basicAuthSecretName: ""
12791279
# -- Including the valid parameter to the `resolver` directive to re-resolve names every `dnsTTL` seconds/minutes
12801280
dnsTTL: "15s"
1281+
# -- Enables all access logs from nginx, otherwise ignores 2XX and 3XX status codes
12811282
verboseLogging: true
12821283
image:
12831284
repository: nginx

0 commit comments

Comments
 (0)