https对CSS文件的请求给出了502 Bad Gateway

时间:2013-09-02 13:21:51

标签: asp.net css ssl iis-7 https

最近,我不得不通过安装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会给出以下响应

https request error for CSS file

注意到IIS 7中Test文件夹上的SSL Settings设置为Accept enter image description here

我该如何解决此问题并通常通过https调用CSS文件?

1 个答案:

答案 0 :(得分:0)

尝试通过

调用您的CSS
<link href="./test/Style/Secure/en/BodyStyle.css" rel="stylesheet" />

当您使用https时,它会将其绑定到您的整个域名。 如果想让你的css3从公众中隐藏起来,那么当你通过html导入时这是不可能的。浏览器需要此文件才能正确呈现您的html设计。