IIS7多域名配置HTTPS(SSL)的方法
使用windows的IIS7配置网站SSL证书时,“主机名”的内容是灰色不可编辑的。这就带来了2个的问题
1. IIS服务器上绑定多个不同的域名,主机上只能启用一个网站的HTTPS,其他网站的HTTPS无法启用。
2. 其他网站用HTTP协议可以正常访问,用HTTPS访问都会指向已绑定HTTPS的网站。例如,IIS有aaa.com、bbb.com、ccc.com三个网站,aaa.com启用了HTTPS,那么https://bbb.com、https://ccc.com都会指向aaa.com。
解决方法
1. 为HTTPS站点分配一个独立的ip,避免公用ip
2. 升级到IIS8,IIS8中添加的对于SNI(Server Name Indication)的支持,服务器可以通请求中提取出相应的主机头从而找到相应的证书。在绑定域名时可以编辑"主机名"。
3. 手动修改IIS7配置文件,为HTTPS增加主机名。
找到 C:\Windows\System32\inetsrv\config\applicationHost.config 文件,
找到如下配置
< bindings>
< binding protocol="http" bindingInformation="*:80:aaa.com" />
< binding protocol="https" bindingInformation="*:443:" />
将
< binding protocol="https" bindingInformation="*:443:" />
改为
< binding protocol="https" bindingInformation="*:443:aaa.com" />
1. IIS服务器上绑定多个不同的域名,主机上只能启用一个网站的HTTPS,其他网站的HTTPS无法启用。
2. 其他网站用HTTP协议可以正常访问,用HTTPS访问都会指向已绑定HTTPS的网站。例如,IIS有aaa.com、bbb.com、ccc.com三个网站,aaa.com启用了HTTPS,那么https://bbb.com、https://ccc.com都会指向aaa.com。
解决方法
1. 为HTTPS站点分配一个独立的ip,避免公用ip
2. 升级到IIS8,IIS8中添加的对于SNI(Server Name Indication)的支持,服务器可以通请求中提取出相应的主机头从而找到相应的证书。在绑定域名时可以编辑"主机名"。
3. 手动修改IIS7配置文件,为HTTPS增加主机名。
找到 C:\Windows\System32\inetsrv\config\applicationHost.config 文件,
找到如下配置
< bindings>
< binding protocol="http" bindingInformation="*:80:aaa.com" />
< binding protocol="https" bindingInformation="*:443:" />
将
< binding protocol="https" bindingInformation="*:443:" />
改为
< binding protocol="https" bindingInformation="*:443:aaa.com" />