#doctor
upstream doc {
server 52.**.**.***:8090;
} #patient
upstream pat {
server 52.**.**.***:8088;
} server {
listen 80;
server_name www.baidu.com; #自己的域名 #patient
location /pat/ {
proxy_set_header host $host;
proxy_set_header X-forwarded-for $proxy_add_x_forwarded_for;
proxy_set_header X-real-ip $remote_addr;
proxy_pass http://pat;
} #doctor
location /doc/ {
proxy_set_header host $host;
proxy_set_header X-forwarded-for $proxy_add_x_forwarded_for;
proxy_set_header X-real-ip $remote_addr;
proxy_pass http://doc;
}
配置完成后进入 "sbin/" 目录下,对nginx 进行重启 :./niginx -s reload
到这里就结束了。