Add i18n multi-language support
This commit is contained in:
@@ -13,6 +13,13 @@ server {
|
||||
add_header Cache-Control "no-cache";
|
||||
}
|
||||
|
||||
location = /i18n/i18n.js {
|
||||
alias /opt/homepage-ybih/i18n/i18n.js;
|
||||
add_header Content-Type "application/javascript; charset=utf-8";
|
||||
add_header Cache-Control "no-cache";
|
||||
access_log off;
|
||||
}
|
||||
|
||||
location /aisearch {
|
||||
proxy_pass http://127.0.0.1:8766/search;
|
||||
proxy_set_header Host $host;
|
||||
@@ -21,11 +28,29 @@ server {
|
||||
add_header Access-Control-Allow-Origin *;
|
||||
}
|
||||
|
||||
location /admin {
|
||||
alias /var/www/html/admin;
|
||||
index index.html;
|
||||
auth_basic "WCC Admin";
|
||||
auth_basic_user_file /etc/nginx/.htpasswd;
|
||||
}
|
||||
|
||||
location /admin/exec {
|
||||
auth_basic "WCC Admin";
|
||||
auth_basic_user_file /etc/nginx/.htpasswd;
|
||||
proxy_pass http://127.0.0.1:8899;
|
||||
}
|
||||
|
||||
location / {
|
||||
proxy_pass http://127.0.0.1:11006;
|
||||
proxy_set_header Host $http_host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
# Disable upstream compression so sub_filter can match
|
||||
proxy_set_header Accept-Encoding "";
|
||||
# Inject i18n script before </body>
|
||||
sub_filter_once on;
|
||||
sub_filter '</body>' '<script src="/i18n/i18n.js" defer></script></body>';
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user