make redirects more robust
This commit is contained in:
parent
e5fd95c5ff
commit
08affd9558
@ -120,6 +120,15 @@ http {
|
|||||||
return 301 $1/$2;
|
return 301 $1/$2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($request_uri ~ ^(.*)/index$) {
|
||||||
|
return 301 $1/;
|
||||||
|
}
|
||||||
|
|
||||||
|
# https://www.twipu.com/GrapheneOS doesn't handle links with fragments properly
|
||||||
|
if ($request_uri ~ "^/(.*)<a href=$") {
|
||||||
|
return 301 https://grapheneos.org/$1;
|
||||||
|
}
|
||||||
|
|
||||||
location = /security.txt {
|
location = /security.txt {
|
||||||
return 301 /.well-known/security.txt;
|
return 301 /.well-known/security.txt;
|
||||||
}
|
}
|
||||||
@ -212,10 +221,6 @@ http {
|
|||||||
return 301 /;
|
return 301 /;
|
||||||
}
|
}
|
||||||
|
|
||||||
location ~ "^(.*)/index$" {
|
|
||||||
return 301 $1/;
|
|
||||||
}
|
|
||||||
|
|
||||||
location ~ "\.(ico|webmanifest)$" {
|
location ~ "\.(ico|webmanifest)$" {
|
||||||
include snippets/security-headers.conf;
|
include snippets/security-headers.conf;
|
||||||
add_header Cache-Control "public, max-age=604800";
|
add_header Cache-Control "public, max-age=604800";
|
||||||
@ -238,11 +243,6 @@ http {
|
|||||||
add_header Cache-Control "public, max-age=1800";
|
add_header Cache-Control "public, max-age=1800";
|
||||||
}
|
}
|
||||||
|
|
||||||
# https://www.twipu.com/GrapheneOS doesn't handle links with fragments properly
|
|
||||||
location ~ "^/(.*)<a href=$" {
|
|
||||||
return 301 https://grapheneos.org/$1;
|
|
||||||
}
|
|
||||||
|
|
||||||
location ~ "\.(br|gz)$" {
|
location ~ "\.(br|gz)$" {
|
||||||
internal;
|
internal;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user