Files

46 lines
1.4 KiB
Plaintext

server {
listen 80;
server_name _;
client_max_body_size 100m;
root /usr/share/nginx/html;
index index.html;
add_header X-Robots-Tag "noindex, nofollow" always;
# 公开构建中的 sw.js 只负责注销该域名历史遗留的后台 PWA。
location = /sw.js {
add_header Cache-Control "no-store, no-cache, must-revalidate";
try_files $uri =404;
}
location = /index.html {
add_header Cache-Control "no-store, no-cache, must-revalidate";
try_files $uri =404;
}
# 员工域名只允许入职公开接口。内部后端路由不包含外层 /api。
location ^~ /api/open/onboarding/ {
proxy_pass http://onboardx-api-svc:5566/open/onboarding/;
proxy_http_version 1.1;
proxy_request_buffering off;
proxy_set_header Host $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;
proxy_connect_timeout 60s;
proxy_read_timeout 300s;
proxy_send_timeout 300s;
}
# 公开域名拒绝系统、后台业务及其他 API。
location ^~ /api/ {
return 404;
}
# Hash 路由的有效链接在服务器看来也是根路径,必须返回公开版 index.html。
location / {
try_files $uri $uri/ /index.html;
}
}