需求1:通过监听服务器的80端口,将请求转发到另一台服务器的8070端口
打开nginx/nginx.conf文件
server {
listen 80;
server_name localhost;
location /analys {
proxy_pass http://10.xx.xx.xx:8070/;
}
}
需求2:通过监听服务器的80端口,将请求转发到另两台服务器的8070端口;
打开nginx/nginx.conf文件
upstream analysnode {
server 10.xx.xx.01:8070;
server 10.xx.xx.02:8070;
}
server {
listen 80;
server_name localhost;
location /analys/ {
proxy_pass http://analysnode/;
proxy_set_header Host $host;
}
}