|
@@ -6,6 +6,11 @@ data:
|
|
|
protocol: {{ include "nginx.scheme" . }}
|
|
|
{{ $timeout := 60 }}
|
|
|
{{ $size := .Values.nextcloud.max_upload_size | default 3 }}
|
|
|
+ {{ $externalAccessPort := printf ":%v" .Values.nginxConfig.externalAccessPort }}
|
|
|
+ {{/* If its 443, do not append it on the rewrite at all */}}
|
|
|
+ {{ if eq $externalAccessPort ":443" }}
|
|
|
+ {{ $externalAccessPort = "" }}
|
|
|
+ {{ end }}
|
|
|
{{/* Safely access key as it is conditionaly shown */}}
|
|
|
{{ if hasKey .Values "nginxConfig" }}
|
|
|
{{ $timeout = .Values.nginxConfig.proxy_timeouts | default 60 }}
|
|
@@ -41,11 +46,19 @@ data:
|
|
|
}
|
|
|
|
|
|
location = /.well-known/carddav {
|
|
|
+ {{ if .Values.nginxConfig.useDifferentAccessPort }}
|
|
|
+ return 301 $scheme://$host{{ $externalAccessPort }}/remote.php/dav;
|
|
|
+ {{ else }}
|
|
|
return 301 $scheme://$host:$server_port/remote.php/dav;
|
|
|
+ {{ end }}
|
|
|
}
|
|
|
|
|
|
location = /.well-known/caldav {
|
|
|
+ {{ if .Values.nginxConfig.useDifferentAccessPort }}
|
|
|
+ return 301 $scheme://$host{{ $externalAccessPort }}/remote.php/dav;
|
|
|
+ {{ else }}
|
|
|
return 301 $scheme://$host:$server_port/remote.php/dav;
|
|
|
+ {{ end }}
|
|
|
}
|
|
|
|
|
|
location / {
|
|
@@ -62,7 +75,11 @@ data:
|
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
|
proxy_set_header X-Forwarded-Proto https;
|
|
|
proxy_set_header X-Forwarded-Host $host;
|
|
|
+ {{ if .Values.nginxConfig.useDifferentAccessPort }}
|
|
|
+ proxy_set_header X-Forwarded-Port {{ .Values.nginxConfig.externalAccessPort }};
|
|
|
+ {{ else }}
|
|
|
proxy_set_header X-Forwarded-Port $server_port;
|
|
|
+ {{ end }}
|
|
|
|
|
|
# Proxy timeouts
|
|
|
proxy_connect_timeout {{ $timeout }}s;
|