nginx 匹配首页怪异问题

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
搞了半天搞不定,有些怪异,求大神们帮忙看看。。
MM们
浏览 335回答 2
2回答

斯蒂芬大帝

location=/{rewrite//index.htmlbreak;root/usr/share/nginx/html;indexindex.html;}
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

JavaScript