From 49fe95869b171aac1cd9eb816194652d351540df Mon Sep 17 00:00:00 2001 From: Jason Thomas Date: Tue, 19 Dec 2023 17:42:53 +0000 Subject: [PATCH 1/2] move rewrite rule into location stanza and set fallback route to index.html --- .../etc/nginx/conf.d/default.conf | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/ui/container-files/etc/nginx/conf.d/default.conf b/ui/container-files/etc/nginx/conf.d/default.conf index 7ff211590..c46b77f33 100644 --- a/ui/container-files/etc/nginx/conf.d/default.conf +++ b/ui/container-files/etc/nginx/conf.d/default.conf @@ -13,13 +13,17 @@ server { root /usr/share/nginx/html; index index.html index.htm; - # Redirect requests for "/ui or /ui/(.*)" to the Angular application in the preferred language of the browser - rewrite ^/ui/?(.*)$ /$accept_language/$1 break; - - # Ensure that everything under the Angular application is always redirected to Angular in the correct language - # For reference on multi language support see: https://angular.io/guide/i18n-common-deploy#configure-a-server - location ~ ^/($accept_language) { - try_files $uri $uri/ /$1/index.html?$args; + 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/(.*)$ /$accept_language/$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/ /$accept_language/index.html?$args; + + # Or use the following line instead + # auto-index on; } } From 14879b77970fb16f7031a6bf658669bcfde38092 Mon Sep 17 00:00:00 2001 From: Jason Thomas Date: Tue, 19 Dec 2023 17:43:20 +0000 Subject: [PATCH 2/2] set en as the default accept_language --- ui/container-files/etc/nginx/nginx.conf | 1 + 1 file changed, 1 insertion(+) diff --git a/ui/container-files/etc/nginx/nginx.conf b/ui/container-files/etc/nginx/nginx.conf index f5db3bafa..22027e11c 100644 --- a/ui/container-files/etc/nginx/nginx.conf +++ b/ui/container-files/etc/nginx/nginx.conf @@ -28,6 +28,7 @@ http { # Browser preferred language detection (does NOT require AcceptLanguageModule) # For reference on multi language support see: https://angular.io/guide/i18n-common-deploy#configure-a-server map $http_accept_language $accept_language { + default en; ~*^cs cs; ~*^de de; ~*^es es;