feat: change to center and clean code
This commit is contained in:
55
nginx/envision-center.conf
Normal file
55
nginx/envision-center.conf
Normal file
@@ -0,0 +1,55 @@
|
||||
|
||||
map $http_upgrade $connection_upgrade {
|
||||
default keep-alive; #默认为keep-alive 可以支持 一般http请求
|
||||
'websocket' upgrade; #如果为websocket 则为 upgrade 可升级的。
|
||||
}
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
server_name center.xiongxiao.me;
|
||||
|
||||
client_max_body_size 1024m;
|
||||
|
||||
location / {
|
||||
proxy_set_header HOST $host;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection $connection_upgrade;
|
||||
|
||||
proxy_http_version 1.1;
|
||||
proxy_read_timeout 86400; # 可选的长时间保持 WebSocket 连接
|
||||
|
||||
proxy_pass http://localhost:3005;
|
||||
}
|
||||
location /api/router {
|
||||
proxy_set_header HOST $host;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection $connection_upgrade;
|
||||
|
||||
proxy_http_version 1.1;
|
||||
proxy_read_timeout 86400; # 可选的长时间保持 WebSocket 连接
|
||||
|
||||
proxy_pass http://localhost:4002/api/router;
|
||||
}
|
||||
location /resources {
|
||||
proxy_set_header HOST $host;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection $connection_upgrade;
|
||||
|
||||
proxy_http_version 1.1;
|
||||
proxy_read_timeout 86400; # 可选的长时间保持 WebSocket 连接
|
||||
|
||||
proxy_pass http://localhost:9000/resources;
|
||||
}
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
|
||||
map $http_upgrade $connection_upgrade {
|
||||
default keep-alive; #默认为keep-alive 可以支持 一般http请求
|
||||
'websocket' upgrade; #如果为websocket 则为 upgrade 可升级的。
|
||||
}
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
server_name envision.xiongxiao.me;
|
||||
|
||||
root /root/apps/envision/web;
|
||||
index index.html;
|
||||
|
||||
client_max_body_size 24m;
|
||||
|
||||
location / {
|
||||
try_files $uri $uri/ =404;
|
||||
}
|
||||
location /api/router {
|
||||
proxy_set_header HOST $host;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection $connection_upgrade;
|
||||
|
||||
proxy_http_version 1.1;
|
||||
proxy_read_timeout 86400; # 可选的长时间保持 WebSocket 连接
|
||||
|
||||
proxy_pass http://localhost:4000/api/router;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user