57 lines
1.8 KiB
Plaintext
57 lines
1.8 KiB
Plaintext
server {
|
|
listen 443 ssl;
|
|
server_name www.yaobai.org;
|
|
ssl_certificate /etc/letsencrypt/live/www.yaobai.org/fullchain.pem;
|
|
ssl_certificate_key /etc/letsencrypt/live/www.yaobai.org/privkey.pem;
|
|
include /etc/letsencrypt/options-ssl-nginx.conf;
|
|
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
|
|
|
|
location /tutorials {
|
|
alias /var/www/html/tutorials;
|
|
index index.html;
|
|
try_files $uri $uri/ =404;
|
|
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;
|
|
proxy_read_timeout 120s;
|
|
proxy_send_timeout 120s;
|
|
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>';
|
|
}
|
|
}
|