nginx反向代理配置
// 前端资源配置
location / {
root vue-project;
index index.html index.htm;
}
// websocket配置
location ~ /test/ws/ {
proxy_pass http://localhost:11003;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_connect_timeout 1800s;
proxy_send_timeout 1800s;
proxy_read_timeout 1800s;
}
// 后台接口配置
location ~ /test/ {
proxy_pass http://localhost:11000;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
}