转发请注明出处:遇到问题–jsp—Nginx转发https导致静态资源无法加载–This request has been blocked
遇到问题
使用nginx作转发,强制tomcat部署的web项目使用https访问。
导致静态资源无法加载访问。
如图
浏览器报错如下:
Mixed Content: The page at 'https://xxxx.com/' was loaded over HTTPS, but requested an insecure stylesheet 'http://xxxx//res/css/style.css'. This request has been blocked; the content must be served over HTTPS.
原因
这是因为浏览器的机制,当https的页面中有其他http的请求时,会被