首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >使用IIS在VPS中托管的域上的HTTP到HTTPS

使用IIS在VPS中托管的域上的HTTP到HTTPS
EN

Stack Overflow用户
提问于 2018-06-05 12:35:08
回答 1查看 88关注 0票数 0

我有一个域名,它的DNS设置指向VPS。

VPS有一个IIS10实例,它使用bootstrap使用html托管简单的网站。

我安装了一个SSL证书,并为https部分添加了绑定。

我能够浏览http和https上的域名。

我在web.config中添加了以下规则:

<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上浏览。

我尝试了以下几种方法:

  1. 尝试安装URL重写,但看起来Windows Server 2016和IIS10不允许installation
  2. Tried启用需要SSL选项。

- This shows the website in http without images but with text
- The website is properly displayed in https

这里我漏掉了什么?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2018-06-06 04:44:35

我安装了错误的URL重写。

这篇文章帮助我用正确的链接解决了这个问题。

自动将http重定向到Windows Server 2016上的https:https://gridscale.io/en/community/tutorials/iis-redirect-http-to-https-windows/

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/50692114

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档