Replace nginx.conf try_files for /$lang/index.html with rewrite (fixes #250)

This commit is contained in:
wiz 2020-12-03 18:52:03 +09:00
parent 8875579c08
commit 129f122993
No known key found for this signature in database
GPG Key ID: A394E332255A6173

View File

@ -33,13 +33,11 @@
# fallback for all URLs i.e. /address/foo /tx/foo /block/000 # fallback for all URLs i.e. /address/foo /tx/foo /block/000
location / { location / {
#return 302 https://mempool.space/$request_uri; try_files /$lang/$uri /$lang/$uri/ $uri $uri/ /en-US/$uri @index-redirect;
try_files /$lang/$uri /$lang/$uri/ $uri $uri/ /en-US/$uri @index;
# /$lang/index.html /en-US/index.html =404;
} }
location @index { location @index-redirect {
add_header Cache-Control must-revalidate; add_header vary accept-language;
try_files /$lang/index.html /en-US/index.html =404; rewrite (.*) /$lang/index.html;
} }
# location block using regex are matched in order # location block using regex are matched in order