1
0
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:
junderw
2021-08-19 07:29:39 +09:00
committed by Nicolas Duchon
parent 691724c81f
commit 1859811311
2 changed files with 13 additions and 3 deletions

View File

@ -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 }}
}
}