asp.net - CSS 文件的 https 请求给出 502 Bad Gateway

标签 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

注意测试文件夹中的 SSL 设置在 IIS 7 中设置为接受 enter image description here

我该如何解决这个问题并正常通过 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/

相关文章:

c# - 浏览器不是以 PDF 格式显示来自 SSRS 服务器的报告,而是显示来自 Web 服务器的原始响应

css - 我的下拉菜单隐藏在 DIV 后面

css - 如何在httpHandler中查找请求是针对js还是css

将 ssl 放在域上后,Wordpress 管理员停止工作

WCF over SSL 问题

asp.net - 如何将 ASP.NET 应用程序部署到 Azure 容器? - 不支持镜像的操作系统版本

javascript - 电话号码文本框问题

html - 如何使用 HTML 在 div 中制作带有图像的网格?

python - Tornado https ssl 错误

Internet Explorer 中的 ASP.Net 禁止 URL