使用IIS托管在VPS中的域上的HTTP到HTTPS
我有一个域名,它的DNS设置指向一个VPS VPS有一个IIS 10实例,它使用html和引导程序托管简单的网站 我安装了SSL证书并为https部分添加了绑定 我能够在http和https上浏览域 我在web.config中添加了以下规则:使用IIS托管在VPS中的域上的HTTP到HTTPS,iis,https,windows-server,Iis,Https,Windows Server,我有一个域名,它的DNS设置指向一个VPS VPS有一个IIS 10实例,它使用html和引导程序托管简单的网站 我安装了SSL证书并为https部分添加了绑定 我能够在http和https上浏览域 我在web.config中添加了以下规则: <system.webServer> <rewrite> <rules> <rule name="HTTP to HTTPS redirect" stopProcessing="true">
<system.webServer>
<rewrite>
<rules>
<rule name="HTTP to HTTPS redirect" stopProcessing="true">
<match url="(.*)" />
<conditions>
<add input="{HTTPS}" pattern="off" ignoreCase="true" />
</conditions>
<action type="Redirect" redirectType="Permanent" url="https://{HTTP_HOST}/{R:1}" />
</rule>
</rules>
</rewrite>
</system.webServer>
然而,这似乎没有帮助。我仍然可以在http上浏览
我尝试了以下方法:
- 这显示了http中的网站,没有图像,但有文本
- 网站以https格式正确显示
我在这里遗漏了什么?我安装了错误的URL重写 本文通过正确的链接帮助我解决了这个问题
Windows Server 2016上的自动IIS将http重定向到https:在此处找到答案:Windows Server 2016上的自动IIS将http重定向到https:删除问题,或发布您的答案,然后接受它。