server {
listen 80;
server_name zhwp.istarshine.com;
root /usr/share/nginx/html;
#charset koi8-r;
#access_log /var/log/nginx/host.access.log main;
location /{
proxy_pass [http://192.168.1.33:8090](http://192.168.1.33:8090);
proxy_set_header X-Real-IP $remote_addr;
}
}
server {
listen 80;
server_name qingdao.istarshine.com;
root /usr/share/nginx/html;
#charset koi8-r;
#access_log /var/log/nginx/host.access.log main;
location /{
proxy_pass [http://192.168.1.181:8070](http://192.168.1.181:8070);
proxy_set_header X-Real-IP $remote_addr;
}
}
nginx反向代理,可同时代理多个网站
如上配置文件所写, 登录不同地址,分别代理到不同服务器的不同端口。