mirror of
https://github.com/SqrtMinusOne/sqrtminusone.github.io.git
synced 2025-12-11 00:03:02 +03:00
feat: redirect should work x2
This commit is contained in:
parent
f9dc1515ec
commit
d669ff4437
1 changed files with 5 additions and 7 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue