请将您的http站点重定向到https站点
今天看我的博客的百度HTTPS认证,验证失败,原因是:请将您的http站点重定向到https站点
解决办法:
将8080端口改为80,8443改为443
<!-- 修改前 -->
<Connector port="8080" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443" />
<!-- 修改前 -->
<Connector port="80" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="443" />
将8009处的8443改为443
<!-- 修改前 -->
<Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />
<!-- 修改前 -->
<Connector port="8009" protocol="AJP/1.3" redirectPort="443" />
在tomcat/config/web.xml的最后</web-app>标签下加上如下配置:
<security-constraint>
<web-resource-collection >
<web-resource-name >SSL</web-resource-name>
<url-pattern>/*</url-pattern>
</web-resource-collection>
<user-data-constraint>
<transport-guarantee>CONFIDENTIAL</transport-guarantee>
</user-data-constraint>
</security-constraint>
验证
重启服务并分别访问 http://www.songbin.top
和 https://www.songbin.top
进行验证HTTPs和HTTP重定向是否生效
注意:本文归作者所有,未经作者允许,不得转载
<security-constraint>
<web-resource-collection >
<web-resource-name >SSL</web-resource-name>
<url-pattern>/*</url-pattern>
</web-resource-collection>
<user-data-constraint>
<transport-guarantee>CONFIDENTIAL</transport-guarantee>
</user-data-constraint>
</security-constraint>
更多内容请访问:IT源点