upstreambackend{server192.168.0.100:80;server192.168.0.100:81;}server{listen80;server_namewww.abc.comabc.com;root/opt/wwwroot/abc.com/;location/{proxy_passhttps://backend;proxy_set_headerHost$host;proxy_set_headerX-Real-IP$remote_addr;proxy_set_headerX-Forwarded-For$proxy_add_x_forwarded_for;proxy_hide_headerX-Powered-By;}location=/{indexindex.htmlindex.htmindex.php;}}我想当用户访问www.abc.com/的时候不走proxy_pass.直接访问本地的/opt/wwwroot/abc.com/index.html页面,其余的请求都走proxy_pass搞了半天搞不定,有些怪异,求大神们帮忙看看。。
2 回答
斯蒂芬大帝
TA贡献1827条经验 获得超8个赞
location=/{rewrite//index.htmlbreak;root/usr/share/nginx/html;indexindex.html;}
添加回答
举报
0/150
提交
取消