最近,我不得不通过安装 SSL 将我的一些网站页面添加到安全页面。当我调用安全网页时出现问题 https://www.myDomain.com/test/httpstest.aspx
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<link href="https://www.myDomain.com/test/Style/Secure/en/BodyStyle.css" rel="stylesheet" />
</head>
<body>
<form id="form1" runat="server">
<div>
Test Https
</div>
</form>
</body>
</html>
此时调用页面时 CSS 给出以下响应
注意测试文件夹中的 SSL 设置在 IIS 7 中设置为接受
我该如何解决这个问题并正常通过 https 调用 CSS 文件?
最佳答案
尝试通过调用你的 css
<link href="./test/Style/Secure/en/BodyStyle.css" rel="stylesheet" />
当您使用 https 时,它会将其绑定(bind)到您的整个域名。 如果想让你的 css3 对其他人隐藏,当你通过 html 导入时这是不可能的。浏览器需要此文件才能正确呈现您的 html 设计。
关于asp.net - CSS 文件的 https 请求给出 502 Bad Gateway,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18574335/