资源不会自动从 Https 加载 - SecuritySwitch
我正在从旧的 SecureWebPages 升级,它通过 web.config 自动在 Http 和 Https 内容之间切换。
由于某些奇怪的原因,具有以下内容:
<link type="text/css" href="assets/css/style.css" rel="stylesheet" />
不再自动从适当的 https 位置加载。 Google Chrome 中的控制台向我显示了以下内容:
The page at https://website.com/UserAccess.aspx ran insecure content from http://website.com/assets/css/style.css.
当我使用较旧的 SecureWebPages 时,此行为不存在。在过去,上面的 CSS 语句工作正常,没有任何错误。
我的网络配置:
<securitySwitch mode="RemoteOnly">
<paths>
<add path="~/Register.aspx"/>
<add path="~/SSL.Master"/>
</paths>
我的配置有什么问题吗?请指教。谢谢!
I am upgrading from the old SecureWebPages that automates the switching between Http and Https content via web.config.
For some strange reason, having contents like:
<link type="text/css" href="assets/css/style.css" rel="stylesheet" />
no longer automatically loads from the appropriate https location. The console in Google Chrome shows me this:
The page at https://website.com/UserAccess.aspx ran insecure content from http://website.com/assets/css/style.css.
This behavior didn't exist when I was using the older SecureWebPages. In the past the above CSS statement works fine without any errors.
My web.config:
<securitySwitch mode="RemoteOnly">
<paths>
<add path="~/Register.aspx"/>
<add path="~/SSL.Master"/>
</paths>
Is there anything wrong with my configurations? Please advise. Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您需要告诉 SecuritySwitch 忽略您的 CSS 文件夹,甚至忽略整个 Assets 文件夹(如果它还包含图像等)。您可以将以下路径添加到资产文件夹的 securitySwitch 部分。
这将告诉 SecuritySwitch 忽略资产文件夹及其下的所有内容。此外,主文件的路径不会执行任何操作,因为 .master 文件永远不会提供给浏览器。
我希望这有帮助!
You need to tell SecuritySwitch to ignore your CSS folder, or even your entire Assets folder if it contains images and the like as well. Here is a path you can add to the securitySwitch section for the assets folder.
This will tell SecuritySwitch to ignore the assets folder, and everything under it. Also, your path for the master file does nothing, since .master files are never served to a browser.
I hope this helps!