Files
vibemake-admin/deploy/nginx.test.conf
T
2026-10-27 14:07:44 +08:00

43 lines
1.3 KiB
Plaintext

server {
listen 80;
server_name dev-vibemake-admin.robotquan.com;
return 301 https://$host$request_uri;
}
server {
listen 443 ssl http2;
server_name dev-vibemake-admin.robotquan.com;
# ssl_certificate /etc/nginx/ssl/dev-vibemake-admin.robotquan.com.pem;
# ssl_certificate_key /etc/nginx/ssl/dev-vibemake-admin.robotquan.com.key;
root /usr/share/nginx/vibemake-admin;
index index.html;
client_max_body_size 60m;
# 后台接口反向代理
location ^~ /admin-api/ {
proxy_pass https://dev-vibemake-api.robotquan.com;
proxy_ssl_server_name on;
proxy_set_header Host dev-vibemake-api.robotquan.com;
# 不转发浏览器 Origin,避免后端 CORS 白名单拒绝(403);同源代理无需 CORS
proxy_set_header Origin "";
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_read_timeout 300s;
proxy_send_timeout 300s;
}
location /assets/ {
expires 30d;
add_header Cache-Control "public, immutable";
}
# SPA history 路由回退
location / {
try_files $uri $uri/ /index.html;
add_header Cache-Control "no-cache";
}
}