修改nnginx.conf文件参数, 配置如下:
http {
#负载均衡的路径
upstream ilikeit.com {
ip_hash;
server 106.15.xx.xx:8080 weight=5;
server 106.15.xx.xx:8099 weight=5;
}
server {
listen 80;
server_name localhost;
location / {
proxy_pass http://ilikeit.com;
proxy_redirect default;
}
#根据访问路径反向代理不同服务器
location ~/fuck/{
proxy_pass http://106.15.39.xx:8088;
}
location ~/love/ {
proxy_pass http://106.15.38.xx:8087;
}
}
}