Skip to content

Commit e2daefb

Browse files
Allow NGINX additional config
Signed-off-by: Florent Poinsaut <florent@poinsaut.fr>
1 parent 8d7b716 commit e2daefb

2 files changed

Lines changed: 11 additions & 31 deletions

File tree

charts/nextcloud/templates/deployment.yaml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,8 +221,13 @@ spec:
221221
mountPath: /var/www/html/themes
222222
subPath: {{ ternary "themes" (printf "%s/%s" .Values.nextcloud.persistence.subPath "themes") (empty .Values.nextcloud.persistence.subPath) }}
223223
- name: nextcloud-nginx-config
224-
mountPath: /etc/nginx/nginx.conf
225-
subPath: nginx.conf
224+
mountPath: /etc/nginx/conf.d/default.conf
225+
subPath: default.conf
226+
{{- if .Values.nginx.config.custom }}
227+
- name: nextcloud-nginx-config
228+
mountPath: /etc/nginx/conf.d/custom.conf
229+
subPath: custom.conf
230+
{{- end }}
226231
{{- end }}
227232
{{- with .Values.nextcloud.extraSidecarContainers }}
228233
{{- toYaml . | nindent 6 }}

charts/nextcloud/templates/nginx-config.yaml

Lines changed: 4 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -9,36 +9,9 @@ metadata:
99
app.kubernetes.io/instance: {{ .Release.Name }}
1010
app.kubernetes.io/managed-by: {{ .Release.Service }}
1111
data:
12-
nginx.conf: |-
1312
{{- if .Values.nginx.config.default }}
14-
worker_processes auto;
15-
16-
error_log /var/log/nginx/error.log warn;
17-
pid /var/run/nginx.pid;
18-
19-
20-
events {
21-
worker_connections 1024;
22-
}
23-
24-
13+
default.conf: |-
2514
http {
26-
include /etc/nginx/mime.types;
27-
default_type application/octet-stream;
28-
29-
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
30-
'$status $body_bytes_sent "$http_referer" '
31-
'"$http_user_agent" "$http_x_forwarded_for"';
32-
33-
access_log /var/log/nginx/access.log main;
34-
35-
sendfile on;
36-
#tcp_nopush on;
37-
38-
keepalive_timeout 65;
39-
40-
#gzip on;
41-
4215
upstream php-handler {
4316
server 127.0.0.1:9000;
4417
}
@@ -169,7 +142,9 @@ data:
169142
}
170143
}
171144
}
172-
{{- else }}
145+
{{- end }}
146+
{{- if .Values.nginx.config.custom }}
147+
custom.conf: |-
173148
{{ .Values.nginx.config.custom | indent 4 }}
174149
{{- end }}
175150
{{- end }}

0 commit comments

Comments
 (0)