项目场景:
nginx 反向代理服务器,client(客户端)能访问B(服务器),B能访问C,client(客户端)不能访问B
问题描述
无法加载CSS等样式
解决方案:
增加CSS样式
location ~ .*\.(html|htm|gif|jpg|jpeg|bmp|png|ico|txt|js|css)$
{
root html;
expires 7d;
}
2.代理到C的网站 后点击登入无法进行跳转
原因:C的网站登入功能访问的不是同一个IP
B服务器代理了登入接口
Server {
listen 3001;
server_name localhost;
location ~{
proxy_pass http://10.229.175.199:2190;#这里是C的服务器Index.html 的接口
}
}
#B服务器需要,在代理C有访问其它的接口
Server {
listen 2191;
server_name localhost;
location ~{
proxy_pass http://10.229.175.199:2191;#这里是C的服务器登入后访问的接口是2191,所以需要增加对应的接口代理,一定也要是2191
}
}