Compare commits

..

No commits in common. "2b29c385aa920bd6865398d5fcc6caefc257c049" and "b7d552a8b0549d4adfc06b15006a53eaabbcb82f" have entirely different histories.

1 changed files with 5 additions and 21 deletions

View File

@ -1,8 +1,3 @@
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
server { server {
listen 80; listen 80;
listen [::]:80; listen [::]:80;
@ -14,25 +9,14 @@ server {
try_files $uri /index.html; try_files $uri /index.html;
} }
# 后端跨域请求 # 后端跨域请求
location ~/api/ { location ~/api/ {
proxy_pass http://192.168.3.98:8200; proxy_pass http://192.168.3.98:1001;
} }
# 配置WebSocket # mock 跨域
location ~/ws/ { location ~/mock/ {
# WebSocket 代理配置 proxy_pass http://192.168.3.98:1001;
proxy_pass http://192.168.3.98:8200; # WebSocket 服务器地址和端口
proxy_http_version 1.1; # 使用 HTTP 1.1 版本
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
proxy_read_timeout 600s; # 保持连接的超时时间,根据需要调整
proxy_redirect off; # 关闭重定向
}
# mock 跨域
location ~/mock/ {
proxy_pass http://192.168.3.98:8200;
} }
error_page 404 404.html; error_page 404 404.html;