mirror of
https://github.com/thib8956/nginx-proxy
synced 2025-07-03 07:15:46 +00:00
feat: redirect using 308 for non-GET requests
This commit is contained in:
14
nginx.tmpl
14
nginx.tmpl
@ -887,9 +887,19 @@ server {
|
||||
|
||||
location / {
|
||||
{{- if eq $globals.config.external_https_port "443" }}
|
||||
return 301 https://$host$request_uri;
|
||||
if ($request_method = GET) {
|
||||
return 301 https://$host$request_uri;
|
||||
}
|
||||
if ($request_method != GET) {
|
||||
return 308 https://$host$request_uri;
|
||||
}
|
||||
{{- else }}
|
||||
return 301 https://$host:{{ $globals.config.external_https_port }}$request_uri;
|
||||
if ($request_method = GET) {
|
||||
return 301 https://$host:{{ $globals.config.external_https_port }}$request_uri;
|
||||
}
|
||||
if ($request_method != GET) {
|
||||
return 308 https://$host:{{ $globals.config.external_https_port }}$request_uri;
|
||||
}
|
||||
{{- end }}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user