This commit is contained in:
ZhuJW
2026-07-10 18:55:55 +08:00
commit fce40c7d6c
317 changed files with 170079 additions and 0 deletions
+60
View File
@@ -0,0 +1,60 @@
server {
listen 80;
server_name 150.158.236.152;
client_max_body_size 100M;
# root /usr/share/nginx/html;
include /etc/nginx/mime.types;
# 处理OPTIONS请求
# location / {
# if ($request_method = 'OPTIONS') {
# add_header 'Access-Control-Allow-Origin' '*' always;
# add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS' always;
# add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range,Authorization' always;
# add_header 'Access-Control-Max-Age' 1728000 always;
# add_header 'Content-Type' 'text/plain; charset=utf-8' always;
# add_header 'Content-Length' 0 always;
# return 204;
# }
# try_files $uri $uri/ /index.html;
# }
location / {
root /usr/share/nginx/html; # 末尾无斜杠
try_files $uri $uri/ /index.html;
}
location /accidentportal/ {
rewrite ^/accidentportal/(.*)$ /$1 last;
}
# 修复API代理
location /accidentportal/api/ {
# rewrite ^/api(.*)$ $1 break;
# proxy_pass http://150.158.236.152:5221/; # 注意结尾斜杠
proxy_buffer_size 128k;
proxy_buffers 16 128k;
proxy_busy_buffers_size 256k;
proxy_max_temp_file_size 1024m;
proxy_pass http://172.17.0.1:5221/accidentportal/api/;
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_set_header X-Forwarded-Host $host;
proxy_connect_timeout 300s;
proxy_send_timeout 300s;
proxy_read_timeout 300s;
# 关键:Cookie处理
proxy_cookie_path / "/; SameSite=Lax";
}
}