# 负载均衡
upstream luisfer{
server 192.168.1.101:8080 weight=5;
server 192.168.1.102:8080 weight=5;
}
location / {
root /app/hoom/ui/dist; # node js 静态文件
index index.html index.htm;
}
location /prod-api/ {
proxy_http_version 1.1;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header X-NginX-Proxy true;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_pass http://127.0.0.1:8080/;
# 结尾 带 / 请求不加 location prod-api
# 结尾 无 / 请求=》 http://127.0.0.1:8080/prod-api
proxy_pass http://luisfer/; #负载均衡,配合 upstream
#proxy_pass http://127.0.0.1:$node_port$request_uri;
proxy_redirect off;
}