1
我有一個在tomcat中部署的web應用程序。應用程序中幾乎所有頁面都需要HTTPS,除了索引頁面和其他頁面。當我訪問任何需要HTTPS的頁面時,瀏覽器始終使用HTTPS。當我訪問不需要HTTPS的頁面時,瀏覽器有時使用HTTP,有時使用HTTPS,這主要取決於源。 我的問題是,如果我可以強制瀏覽器使用HTTP(沒有s)那些不需要加密的頁面。Tomcat - 我可以強迫非HTTPS?
這是我的web.xml的一部分,它決定哪些資源需要加密。
<security-constraint>
<web-resource-collection>
<web-resource-name>Protected</web-resource-name>
<url-pattern>/*</url-pattern>
</web-resource-collection>
<user-data-constraint>
<transport-guarantee>CONFIDENTIAL</transport-guarantee>
</user-data-constraint>
</security-constraint>
<security-constraint>
<web-resource-collection>
<web-resource-name>Open</web-resource-name>
<url-pattern>/</url-pattern>
<url-pattern>/contact</url-pattern>
<url-pattern>/robots.txt</url-pattern>
<url-pattern>/sitemap.xml</url-pattern>
</web-resource-collection>
<user-data-constraint>
<transport-guarantee>NONE</transport-guarantee>
</user-data-constraint>
</security-constraint>
與選項3的問題是,我們不能鏈接到外部資源,如CDN託管的HTTP頁面的JavaScript庫。我會找出哪個選項對我們來說是最好的。 – 2013-03-22 12:16:18