commit e4bf87bdca07c4ad1a6a3b875ff94014f5cf2faf
parent cee6d591b58db2bbb99d785252efaf0cf2795229
Author: Florian Dold <florian.dold@gmail.com>
Date: Sat, 16 Dec 2017 21:26:04 +0100
more acurate language detection
Diffstat:
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/etc/nginx/nginx.conf b/etc/nginx/nginx.conf
@@ -58,10 +58,16 @@ http {
# for now it's good enough.
map $http_accept_language $index_redirect_uri {
default "en";
- ~en "en";
- ~de "de";
- ~fr "fr";
- ~es "it";
+ # prefer language that's first in the list
+ ~^en "en";
+ ~^de "de";
+ ~^fr "fr";
+ ~^es "it";
+ # if none matches, take one later in the list
+ ~,en "en";
+ ~,de "de";
+ ~,fr "fr";
+ ~,es "it";
}
##