我在我的web应用程序中配置了SSL。根据所需的步骤,我已将证书安装在Tomcat中。在Apache Tomcat中执行301从http重定向到https
,我已被以下的教程是 https://www.mulesoft.com/tcat/tomcat-security
我已经强迫通过http使用https这意味着为http的任何请求将被转发到https。我改变了我的server.xml中的以下变化
<Connector port="8080" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="443"
proxyHost="10.1.1.1" proxyPort="80"
URIEncoding="UTF-8"
maxHttpHeaderSize="32768"/>
是web.xml中的变化如下:
<security-constraint>
<web-resource-collection>
<web-resource-name>SecureConnection</web-resource-name>
<url-pattern>/*</url-pattern>
</web-resource-collection>
<user-data-constraint>
<transport-guarantee>CONFIDENTIAL</transport-guarantee>
</user-data-constraint>
</security-constraint>
然而,重定向这是发生的临时重新指导,即302. 我想使用301重定向即永久重定向。
我该如何做到这一点?
你是否找到了这个问题的答案?我也有同样的问题。 – Thermometer
同样在这里,在这个问题上的任何进展? – Default71721
对于Google员工现在只想“强制执行https tomcat”,“始终https tomcat”或类似的情况,这就是解决方案。 https://jelastic.zendesk.com/hc/en-us/community/posts/206121996-HTTP-HTTPS-redirection-into-the-Tomcat也提供了一个解决方案。 – koppor