From 675ed8c69eb1bc82ce435c0a0804597f7c164def Mon Sep 17 00:00:00 2001 From: Jason Thomas Date: Mon, 18 Dec 2023 17:09:05 +0000 Subject: [PATCH] updated rewrite rule --- ui/container-files/etc/nginx/conf.d/default.conf | 11 ++++------- 1 file changed, 4 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 e6a068202..d35af791d 100644 --- a/ui/container-files/etc/nginx/conf.d/default.conf +++ b/ui/container-files/etc/nginx/conf.d/default.conf @@ -13,18 +13,15 @@ server { root /usr/share/nginx/html; index index.html index.htm; - # Redirect requests for "/ui/(.*)" to Angular application in the preferred language of the browser - rewrite ^/ui/(.*) /$accept_language/$1 break; + # Redirect requests for "/ui or /ui/(.*)" to the Angular application in the preferred language of the browser + rewrite ^/ui/?(.*)$ /$accept_language/$1 break; - # Everything under the Angular application is always redirected to Angular in the correct language + # 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 ~ ^/(cs|de|es|fr|it|ja|ko|pt|ru|ui|zh-CN|zh-TW) { + location ~ ^/($accept_language) { try_files $uri $uri/ /$1/index.html?$args; } - # Can use this line below instead of the location stanza above - # Everything under the Angular application is always redirected to Angular in the correct language - #try_files $uri $uri/ /$accept_language/index.html?$args; } }