Skip to content

Commit

Permalink
Allow NGINX additional config
Browse files Browse the repository at this point in the history
Signed-off-by: Florent Poinsaut <[email protected]>
  • Loading branch information
FlorentPoinsaut committed May 11, 2023
1 parent a215de8 commit 3b8d2ac
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 31 deletions.
9 changes: 7 additions & 2 deletions charts/nextcloud/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -239,8 +239,13 @@ spec:
mountPath: /var/www/html/themes
subPath: {{ ternary "themes" (printf "%s/%s" .Values.nextcloud.persistence.subPath "themes") (empty .Values.nextcloud.persistence.subPath) }}
- name: nextcloud-nginx-config
mountPath: /etc/nginx/nginx.conf
subPath: nginx.conf
mountPath: /etc/nginx/conf.d/default.conf
subPath: default.conf
{{- if .Values.nginx.config.custom }}
- name: nextcloud-nginx-config
mountPath: /etc/nginx/conf.d/custom.conf
subPath: custom.conf
{{- end }}
{{- if .Values.nextcloud.extraVolumeMounts }}
{{- toYaml .Values.nextcloud.extraVolumeMounts | nindent 8 }}
{{- end }}
Expand Down
33 changes: 4 additions & 29 deletions charts/nextcloud/templates/nginx-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,36 +9,9 @@ metadata:
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
data:
nginx.conf: |-
{{- if .Values.nginx.config.default }}
worker_processes auto;

error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;


events {
worker_connections 1024;
}


nginx.conf: |-
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;

log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';

access_log /var/log/nginx/access.log main;

sendfile on;
#tcp_nopush on;

keepalive_timeout 65;

#gzip on;

upstream php-handler {
server 127.0.0.1:9000;
}
Expand Down Expand Up @@ -169,7 +142,9 @@ data:
}
}
}
{{- else }}
{{- end }}
{{- if .Values.nginx.config.custom }}
custom.conf: |-
{{ .Values.nginx.config.custom | indent 4 }}
{{- end }}
{{- end }}

0 comments on commit 3b8d2ac

Please sign in to comment.