IIS7下的https無(wú)法綁定主機(jī)頭,顯示灰色怎么辦
IIS7下的https無(wú)法綁定主機(jī)頭,顯示灰色,原因是IIS7不支持SNI,即一個(gè)IP只能綁定到一個(gè)HTTPS站點(diǎn)上。
網(wǎng)上的資料大部分都是建議修改IIS7配置文件直接指定主機(jī)名,內(nèi)容如下:
打開(kāi)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.tjdsmy.cn" />
</bindings>
找到https的配置項(xiàng)目行,修改為:
<binding protocol="https" bindingInformation="*:443:www.tjdsmy.cn" />
注意這里的www.tjdsmy.cn要換成你自己的域名,之后保存即可。
這樣操作的確是主機(jī)頭和443端口對(duì)應(yīng)了,但是我們會(huì)發(fā)現(xiàn)其實(shí)多個(gè)站點(diǎn)https訪問(wèn)后請(qǐng)求到的證書只是最后一個(gè)配置的站點(diǎn),這就導(dǎo)致還是只有一個(gè)域名可以正常使用https.
如何處理這個(gè)問(wèn)題呢?
方式1:購(gòu)買多個(gè)IP,每個(gè)IP解析一個(gè)域名,在綁定HTTPS時(shí)指定IP
方式2:使用kangle,apache等來(lái)做反代IIS,在前端web服務(wù)器上綁定https.
方式3:更換為支持SNI的IIS版本,比如2012R2系統(tǒng)。
會(huì)員登錄
賬號(hào)登錄還沒(méi)有賬號(hào)?立即注冊(cè)