IIS7 https无法绑定主机头,显示灰色

2017-12-29 0 1,520 百度已收录

据了解,windows IIS7下面默认HTTPS绑定是无法指定主机头的,但我们可以通过手工修改IIS配置来实现主机头绑定。

打开C:\Windows\system32\inetsrv\config\applicationHost.config

定位到如下位置:
<bindings>
<binding protocol=”https” bindingInformation=”*:443″ />
<binding protocol=”net.tcp” bindingInformation=”808:*” />
<binding protocol=”net.pipe” bindingInformation=”*” />
<binding protocol=”net.msmq” bindingInformation=”localhost” />
<binding protocol=”msmq.formatname” bindingInformation=”localhost” />
<binding protocol=”http” bindingInformation=”*:80:www.lizi.tw” /> </bindings>
找到https的配置项目行,修改为:
<binding protocol=”https” bindingInformation=”*:443:www.www.lizi.tw” />
注意这里的www.lizi.tw要换成你自己的域名,之后保存即可。

然后在弄个规则

<rule name=”Redirect to HTTPs” stopProcessing=”true”>
<match url=”(.*)” />
<conditions>
<add input=”{HTTP_HOST}” pattern=”^(localhost)” negate=”true” />
<add input=”{HTTPS}” pattern=”^OFF$” />
</conditions>
<action type=”Redirect” url=”https://{HTTP_HOST}/{R:1}” redirectType=”SeeOther” />
</rule>

这个规则复制到web.config 里面。就可以http跳转到https

收藏 (0) 打赏

感谢您的支持,我会继续努力的!

打开微信/支付宝扫一扫,即可进行扫码打赏哦,分享从这里开始,精彩与您同在
点赞 (0)

栗子博客 网站 IIS7 https无法绑定主机头,显示灰色 https://www.lizi.tw/web/3555.html

建筑工地上施工员,闲暇时弄个博客打发时间,

常见问题
  • 1、杰齐1.7仅适用于PHP5.2 2、需Zend支持 3、尽量使用宝塔面板 4、尽量使用Windows 系统,关关对Linux支持不太友好。
查看详情

相关文章

评论
暂无评论
官方客服团队

为您解决烦忧 - 24小时在线 专业服务

IIS7 https无法绑定主机头,显示灰色-海报

分享本文封面