From 129f122993f877130d15fd7bafa4a57efa37e048 Mon Sep 17 00:00:00 2001 From: wiz Date: Thu, 3 Dec 2020 18:52:03 +0900 Subject: [PATCH] Replace nginx.conf try_files for /$lang/index.html with rewrite (fixes #250) --- production/nginx-mempool.conf | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/production/nginx-mempool.conf b/production/nginx-mempool.conf index d28f7f456..617c4cadf 100644 --- a/production/nginx-mempool.conf +++ b/production/nginx-mempool.conf @@ -33,13 +33,11 @@ # fallback for all URLs i.e. /address/foo /tx/foo /block/000 location / { - #return 302 https://mempool.space/$request_uri; - try_files /$lang/$uri /$lang/$uri/ $uri $uri/ /en-US/$uri @index; -# /$lang/index.html /en-US/index.html =404; + try_files /$lang/$uri /$lang/$uri/ $uri $uri/ /en-US/$uri @index-redirect; } - location @index { - add_header Cache-Control must-revalidate; - try_files /$lang/index.html /en-US/index.html =404; + location @index-redirect { + add_header vary accept-language; + rewrite (.*) /$lang/index.html; } # location block using regex are matched in order