-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update location and try_files directive
- Loading branch information
1 parent
8337c83
commit 0fc1b99
Showing
1 changed file
with
26 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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/<langCode>/" 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; | ||
} | ||
|
||
} | ||
} | ||
|
||
} |