一个服务器要绑定多个HTTPS站点

默认状况一个服务器的IIS只能绑定一个HTTPS也就是443端口web

要实现多个站点对应HTTPS只能更改IIS配置服务器

地址:C:\Windows\system32\inetsrv\config\applicationHost.config、app

默认一个站点带一个这样的配置post

    <binding protocol="https" bindingInformation="*:443" />url

修改为:orm

      <binding protocol="https" bindingInformation="*:443:www.baidu.om" />blog

切记须要对应的每一个站点都修改。get

 

appcmd set site /site.name:"wb_KamDai.PortalSystem.W
eb" /+bindings.[protocol='https',bindingInformation='*:443:www.wb.com']input

 
 
IIS重定向组件 
 
注意首先要安装url重定向模块
而后在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="Found" url="https://{HTTP_HOST}/{R:1}" />
    </rule>
   </rules>
  </rewrite>
    </system.webServer>
相关文章
相关标签/搜索