Skip to content

Commit 3b8d2ac

Browse files
Allow NGINX additional config
Signed-off-by: Florent Poinsaut <florent@poinsaut.fr>
1 parent a215de8 commit 3b8d2ac

File tree

2 files changed

+11
-31
lines changed

2 files changed

+11
-31
lines changed

charts/nextcloud/templates/deployment.yaml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -239,8 +239,13 @@ spec:
239239
mountPath: /var/www/html/themes
240240
subPath: {{ ternary "themes" (printf "%s/%s" .Values.nextcloud.persistence.subPath "themes") (empty .Values.nextcloud.persistence.subPath) }}
241241
- name: nextcloud-nginx-config
242-
mountPath: /etc/nginx/nginx.conf
243-
subPath: nginx.conf
242+
mountPath: /etc/nginx/conf.d/default.conf
243+
subPath: default.conf
244+
{{- if .Values.nginx.config.custom }}
245+
- name: nextcloud-nginx-config
246+
mountPath: /etc/nginx/conf.d/custom.conf
247+
subPath: custom.conf
248+
{{- end }}
244249
{{- if .Values.nextcloud.extraVolumeMounts }}
245250
{{- toYaml .Values.nextcloud.extraVolumeMounts | nindent 8 }}
246251
{{- end }}

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+
nginx.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)