upstream hostpath {
server 127.0.0.1:9501;
server 127.0.0.1:9503;
}
server {
listen 80;
server_name localhost;
#charset koi8-r;
#access_log logs/host.access.log main;
location / {
root html;
index index.html index.htm;
if (!-e $request_filename) {
#proxy_pass http://127.0.0.1:9501;
proxy_pass http://hostpath;
}
}
修改nginx.conf,在里面加入红色部分代码