2025-12-29 08:12:05 +08:00
|
|
|
worker_processes 1;
|
|
|
|
|
|
|
|
|
|
events {
|
|
|
|
|
worker_connections 1024;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
http {
|
|
|
|
|
include mime.types; # 引入 MIME 类型
|
|
|
|
|
default_type application/octet-stream; # 默认 MIME 类型
|
|
|
|
|
|
|
|
|
|
server {
|
2025-12-29 14:04:41 +08:00
|
|
|
listen 88;
|
|
|
|
|
server_name erp.qihangerp.cn;
|
2025-12-29 08:12:05 +08:00
|
|
|
|
|
|
|
|
# 设置 Vue 应用的静态文件路径
|
|
|
|
|
root /usr/share/nginx/html;
|
|
|
|
|
index index.html;
|
|
|
|
|
|
|
|
|
|
# 默认 location 配置
|
|
|
|
|
location / {
|
|
|
|
|
try_files $uri $uri/ /index.html;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# 处理 /prod-api/ 的代理请求
|
|
|
|
|
location /prod-api/ {
|
|
|
|
|
proxy_set_header Host $http_host;
|
|
|
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
|
|
|
proxy_set_header REMOTE-HOST $remote_addr;
|
|
|
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
|
|
|
# --- 新增 SSE 关键配置 ---
|
|
|
|
|
proxy_http_version 1.1; # 必须使用 HTTP/1.1
|
|
|
|
|
proxy_buffering off; # 关闭缓冲,确保数据实时发送
|
|
|
|
|
proxy_read_timeout 1800s; # 增加读取超时时间 (例如 30 分钟)
|
|
|
|
|
proxy_send_timeout 1800s; # 增加发送超时时间 (例如 30 分钟)
|
|
|
|
|
proxy_connect_timeout 60s; # 连接超时时间
|
|
|
|
|
# --- 结束新增 ---
|
|
|
|
|
|
2025-12-29 14:04:41 +08:00
|
|
|
proxy_pass http://10.0.2.22:8088/;
|
|
|
|
|
#proxy_pass http://172.17.62.227:8088/;
|
2025-12-29 08:12:05 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|