updated server configuration

document root is at /usr/share/nginx/html
map app is located in /usr/share/nginx/html
server responds to /, /map, /map/, /karte, /karte/
server uses DE or EN page depending on $http_accept_language as set by client
This commit is contained in:
Kasper D. Fischer 2021-10-30 22:38:57 +02:00
parent af7c6642ff
commit bbee8038a2
2 changed files with 23 additions and 8 deletions

View File

@ -10,4 +10,4 @@ COPY nginx/mime.types /etc/nginx/mime.types
COPY nginx/default.conf /etc/nginx/conf.d/default.conf
# copy webpage content
COPY www /usr/share/nginx/html
COPY www /usr/share/nginx/html/map

View File

@ -16,16 +16,31 @@ server {
set $language_suffix 'de';
}
location / {
root /usr/share/nginx/html;
index index.html.$language_suffix index.htm.$language_suffix index.html index.htm
try_files $uri.$language_suffix $uri $uri.html.$language_suffix $uri.html $uri.htm.$language_suffix $uri.htm;
#rewrite rules to /map/
rewrite ^(.*)/index(\.html)*$ /map/index.html.$language_suffix last;
rewrite ^/favicon.ico$ /map/favicon.ico last;
rewrite ^/map$ /map/ last;
rewrite ^/map.js$ /map/map.js last;
rewrite ^/karte$ /map/ last;
rewrite ^/karte/$ /map/ last;
rewrite ^/karte/(.*)$ /map/$1 last;
if ($uri !~ "^/map") {
rewrite ^(.*)/(.*)$ /map$1/$2 last;
}
#location / {
# root /usr/share/nginx/html;
# index index.html index.htm;
#location /map {
# root /usr/share/nginx/html/;
# index index.html.$language_suffix index.html;
# #try_files $uri.$language_suffix $uri.html.$language_suffix $uri.html $uri index.html.$language_suffix index.html;
#}
location / {
root /usr/share/nginx/html/;
index index.html.$language_suffix index.html;
}
#error_page 404 /404.html;
# redirect server error pages to the static page /50x.html