Skip to content

Commit

Permalink
Merge pull request #1071 from ORCID/feature/nginx_language_config_update
Browse files Browse the repository at this point in the history
Feature/nginx language config update
  • Loading branch information
auumgn authored Dec 19, 2023
2 parents fc2f3f2 + 14879b7 commit 78ca64d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
18 changes: 11 additions & 7 deletions ui/container-files/etc/nginx/conf.d/default.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

}
Expand Down
1 change: 1 addition & 0 deletions ui/container-files/etc/nginx/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 78ca64d

Please sign in to comment.