springboot应用多节点部署和配置nginx访问

1、多节点启动

节点1:120.79.160.143:8082/
节点2:47.106.120.173:8080

2、配置nginx集群访问

             upstream lbs {
​
                server 120.79.160.143:8082;   
                server 127.0.0.1:8080;      
​
            }
​
​
            location /api/ {
                    proxy_pass http://lbs;
                    proxy_redirect default;
                }
​
            location /user/ {
                    proxy_pass http://lbs;
                    proxy_redirect default;
                }
​
     3、重启nginx命令
        ./nginx -s reload  

你可能感兴趣的:(服务器,springboot)