如何解决在 http 上提供静态文件,在 https 上提供其他文件
我在外部 tomcat 上部署了一个 Spring Boot 应用程序。
我的 url 在前端配置了 https://sampleTest.com。
在 index.html 中,我有像
这样的静态资源<link rel="stylesheet" type="text/css" href="assets/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="assets/css/bootstrap.min.js">
我想在 http 上提供静态资源,在 https 上提供其他资源。
当我进入 sampleTest.com 时,它在 https 上提供静态资源。
当我输入 http://sampleTest.com 错误网页无法找到。
server.xml:
<Connector port="80" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="443" />
<Connector port="443" protocol="org.apache.coyote.http11.Http11NioProtocol"
maxThreads="150"
minSpareThreads="25"
maxSpareThreads="75"
scheme="https"
secure="true"
SSLEnabled="true"
clientAuth="false"
sslProtocol="TLS"
keystoreFile="keystore location"
keystorePass="key"/>
web.xml:
<security-constraint>
<web-resource-collection>
<web-resource-name> unsecure url</web-resource-name>
<url-pattern>/assets/*</url-pattern>
</web-resource-collection>
<user-data-constraint>
<transport-guarantee>NONE</transport-guarantee>
</user-data-constraint>
</security-constraint>
谢谢
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。