Files
shz-admin/scripts/nginx-shz-admin.conf

45 lines
1.4 KiB
Plaintext
Raw Normal View History

# shz-admin 前端与现有 SHZ 后端代理配置。
# 安装位置:/etc/nginx/default.d/shz-admin.conf
client_max_body_size 100m;
location = /shihezi {
return 301 /shihezi/;
}
location = /shihezi/index.html {
alias /opt/service/project/shz-admin/dist/index.html;
add_header Cache-Control "no-cache, no-store, must-revalidate" always;
}
location /shihezi/ {
alias /opt/service/project/shz-admin/dist/;
try_files $uri $uri/ /shihezi/index.html;
add_header Cache-Control "no-cache" always;
}
location /api/shihezi/ {
# 对外保留 /api/shihezi/ 前缀,转发到本机后端时剥离该前缀。
proxy_pass http://127.0.0.1:9091/;
proxy_http_version 1.1;
proxy_set_header Host $proxy_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-Host $host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_read_timeout 300s;
proxy_send_timeout 300s;
proxy_buffering off;
}
location /data/file/ {
proxy_pass http://127.0.0.1:9091/data/file/;
proxy_http_version 1.1;
proxy_set_header Host $proxy_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-Host $host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_read_timeout 300s;
}