国学经典,永久流传《诗经朗诵全集》
《诗经朗诵全集》带你领略国学经典,永久咏传。...
2023-07-31
客户反映:说了你的网站是nginx代理的,打开空 white。直接IP加地址访问是好的(http://ip:port)
故障排除:
1.打开chrome浏览器并访问它。拜访情况确实如客户描述的那样。
2.感觉打开了开发者工具chrome,发现有些请求网址是404,css,js。
3.找到客户希望服务器登录的帐户,并检查nginx配置文件。
upstream www.test.com{ server 127.0.0.1:8080;}server { listen 80; listen 443 ssl http2; ssl_certificate /usr/local/nginx/conf/ssl/www.test.com.pem; ssl_certificate_key /usr/local/nginx/conf/ssl/www.test.com.key; server_name www.test.com; access_log /data/wwwlogs/www.test.com_nginx.log combined; index index.html index.htm index.jsp; root /data/wwwroot/www.test.com; location ~ .*\\.(js|css)?$ { expires 7d; access_log off; } location / { proxy_pass http://www.test.com; include proxy.conf; }}
4.上面的配置有没有发现什么问题?起初,我没有注意到我认为配置文件是正确的。
我准备查一下nginx的日志,再次请求网址,再次检查nginx还是404。(我感觉很困惑),而且proxy _ pass http://www.test.com配置的很清楚。
失败原因:
因为“位置~。*\\.(js|css)”?$ \"的匹配被拦截,请求无法正常发送到下一个“location/”上,因此无法正常到达后端proxy_pass。
解决方法:
第一种解决方案是把后端静态文件(css和js)放到前端nginx machine/data/data/wwwroot/www . test . com中
第二种解决方案:修改配置文件。
upstream www.test.com{ server 127.0.0.1:8080;}server { listen 80; listen 443 ssl http2; ssl_certificate /usr/local/nginx/conf/ssl/www.test.com.pem; ssl_certificate_key /usr/local/nginx/conf/ssl/www.test.com.key; server_name www.test.com; access_log /data/wwwlogs/www.test.com_nginx.log combined; index index.html index.htm index.jsp; root /data/wwwroot/www.test.com; location ~ .*\\.(js|css)?$ { proxy_pass http://www.test.com; expires 7d; access_log off; } location / { proxy_pass http://www.test.com; include proxy.conf; }}
以上内容就是为大家推荐的为什么网页打开是空白的(网页链接打开是空白页)最佳回答,如果还想搜索其他问题,请收藏本网站或点击搜索更多问题
内容来源于网络仅供参考版权声明:所有来源标注为小樱知识网www.xiaoyin02.com的内容版权均为本站所有,若您需要引用、转载,只需要注明来源及原文链接即可。
本文标题:为什么网页打开是空白的(网页链接打开是空白页)
本文地址:https://www.xiaoyin02.com/shcs/578101.html
相关文章
热点文章
2021年独生子女补贴新政策是真的吗(独生子女证有有效期吗)
2021年国庆节阅兵仪式几点开始几点结束(2021年国庆节还有阅兵吗)
鼠目寸光一点红是什么生肖动物(鼠目寸光一点红)指什么生肖,紧密
k0到k9的玩法大全(强制gc的玩法和注意事项)
入土为安是什么生肖《入土为安》打一个生肖动物,词语解释
浙江12月底全面停工是真的吗(浙江什么时候放假停工)
如何做t(t怎么把p做哭)
北京口碑最差的三甲医院(北京301医院最擅长什么)