proxy_pass http://rrups;
upstream rrups {
hash user_$arg_username;
server 192.168.137.3:8011;
server 192.168.137.3:8012;
}
location /aa {
#rewrite ^/admin http://baidu.com;
#alias /var/www/html/;
proxy_pass http://rrups;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Scheme $scheme;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
node2:/etc/nginx#curl http://192.168.137.2:2443/aa/bb/cc
8012 server response /aa/bb/cc node2:/etc/nginx#
如果proxy_pass 添加了uri
location /aa {
#rewrite ^/admin http://baidu.com;
#alias /var/www/html/;
proxy_pass http://rrups/www;
node2:/etc/nginx#curl http://192.168.137.2:2443/aa/bb/cc
8012 server response /www/bb/cc node2:/etc/nginx#