feat: redirect should work x2

This commit is contained in:
Pavel Korytov 2021-12-11 21:08:46 +03:00
parent f9dc1515ec
commit d669ff4437

View file

@ -3,14 +3,12 @@ server {
server_name sqrtminusone.xyz;
root /usr/share/nginx/html;
location / {
try_files $uri @redirect;
}
location @redirect {
if ($uri ~* ^(.+)/$) { rewrite ^ $uri/index.html last; }
if (-d $document_root$uri) { return $scheme://$host:8080$uri/; }
return 404;
location / {
if ( $request_uri ~ "/index.html" ) {
rewrite ^/(.*)/ /$1 permanent;
}
try_files $uri $uri/index.html $uri.html =404;
}
error_page 500 502 503 504 /50x.html;