diff --git a/ui/container-files/etc/nginx/conf.d/default.conf b/ui/container-files/etc/nginx/conf.d/default.conf index c0427993b..e80ff31a9 100644 --- a/ui/container-files/etc/nginx/conf.d/default.conf +++ b/ui/container-files/etc/nginx/conf.d/default.conf @@ -1,43 +1,36 @@ map $cookie_locale $langCode { - default en; - ~*^cs cs; - ~*^de de; - ~*^es es; - ~*^fr fr; - ~*^it it; - ~*^ja ja; - ~*^ko ko; - ~*^pt pt; - ~*^ru ru; - ~*^ui ui; - ~*^zh-CN zh-CN; - ~*^zh-TW zh-TW; + default en; + ~*^cs cs; + ~*^de de; + ~*^es es; + ~*^fr fr; + ~*^it it; + ~*^ja ja; + ~*^ko ko; + ~*^pt pt; + ~*^ru ru; + ~*^ui ui; + ~*^zh-CN zh-CN; + ~*^zh-TW zh-TW; } server { - listen 8090; - server_name localhost; + listen 8090; + server_name localhost; - #access_log /var/log/nginx/host.access.log main; + # Uncomment logfile entries for debug of requests recieved by this virtual host. + #access_log /var/log/nginx/host.access.log main; + #error_log /var/log/nginx/host.access.log notice; - location / { - root /usr/share/nginx/html; - index index.html index.htm; - - location ~ ^/ui/(.*) { - # Redirect requests for `/ui/(.*)` to the Angular application in the preferred language of the browser - # For reference on multi language support see: https://angular.io/guide/i18n-common-deploy#configure-a-server - rewrite ^/ui/(.*)$ /${langCode}/$1 break; - - # Configure a fallback route in the NGinX server to serve the index.html when requests arrive for `/ui/login` - # Requires static html content to have a `base-href=./` entry - try_files $uri $uri/ /${langCode}/index.html?$args; - - # Or use the following line instead - # auto-index on; - } + location / { + root /usr/share/nginx/html; + index index.html index.htm; + # Requires base href {in the index.html files} be set to "./" or "/ui//" e.g "/ui/it/" or "/ui/en/" ############################################################# + location ~ ^/(cs|de|en|es|fr|it|ja|ko|pt|ru|zh-CN|zh-TW)/(.*) { + try_files $uri $uri/ /$1/index.html?$args; } -} + } +} diff --git a/ui/container-files/etc/nginx/nginx.conf b/ui/container-files/etc/nginx/nginx.conf index 7b7dbe13c..b936200e9 100644 --- a/ui/container-files/etc/nginx/nginx.conf +++ b/ui/container-files/etc/nginx/nginx.conf @@ -5,26 +5,26 @@ error_log /var/log/nginx/error.log notice; pid /var/run/nginx.pid; events { - worker_connections 1024; + worker_connections 1024; } http { - include /etc/nginx/mime.types; - default_type application/octet-stream; + include /etc/nginx/mime.types; + default_type application/octet-stream; - log_format main '$remote_addr - $remote_user [$time_local] "$request" ' - '$status $body_bytes_sent "$http_referer" ' - '"$http_user_agent" "$http_x_forwarded_for"'; + log_format main '$remote_addr - $remote_user [$time_local] "$request" ' + '$status $body_bytes_sent "$http_referer" ' + '"$http_user_agent" "$http_x_forwarded_for"'; - access_log /var/log/nginx/access.log main; + access_log /var/log/nginx/access.log main; - sendfile on; - #tcp_nopush on; + sendfile on; + #tcp_nopush on; - keepalive_timeout 65; + keepalive_timeout 65; - #gzip on; + #gzip on; - include /etc/nginx/conf.d/*.conf; + include /etc/nginx/conf.d/*.conf; }