redirect 404 /page/ to /page if /page.html exists
This commit is contained in:
parent
372046813f
commit
7a7648e6de
@ -283,11 +283,21 @@ http {
|
||||
internal;
|
||||
}
|
||||
|
||||
location ~ "(\.html|/)$" {
|
||||
location ~ "/$" {
|
||||
include snippets/security-headers.conf;
|
||||
add_header Cross-Origin-Resource-Policy "same-origin" always;
|
||||
add_header Cache-Control "public, no-cache";
|
||||
include snippets/preload.conf;
|
||||
try_files ${uri}index.html @noslash;
|
||||
}
|
||||
|
||||
# redirect /path/ to /path if /path.html exists
|
||||
location @noslash {
|
||||
rewrite ^(.*)/$ $1;
|
||||
if (-f $request_filename.html) {
|
||||
rewrite ^(.*) $1 permanent;
|
||||
}
|
||||
return 404;
|
||||
}
|
||||
|
||||
location = /install/web {
|
||||
|
Loading…
x
Reference in New Issue
Block a user