zoukankan      html  css  js  c++  java
  • IIS7 HTTPS 绑定主机头

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

    打开C:Windowssystem32inetsrvconfigapplicationHost.config

    定位到如下位置:
    <bindings>
    <binding protocol="https" bindingInformation="*:443" />
    <binding protocol="http" bindingInformation="*:80:abc.demo.com" />
    </bindings>

    找到https的配置项目,修改为:

    <binding protocol="https" bindingInformation="*:443:abc.demo.com" />

    注意这里的abc.demo.com要换成你自己的域名,之后保存即可。

    ===================================小割割=============================================

    这样操作的确是主机头和443端口对应了,但是我们会发现其实多个站点https访问后请求到的证书只是最后一个配置的站点,这就导致还是只有一个域名可以正常使用https.

    如何处理这个问题呢?

    方式1:购买多个IP,每个IP解析一个域名,在绑定HTTPS时指定IP

    方式2:使用kangle,apache等来做反代IIS,在前端web服务器上绑定https.

    方式3:更换为支持SNI的IIS版本,比如2012R2系统。

    ===================================小割割=============================================

    默认情况一个服务器的IIS只能绑定一个HTTPS也就是443端口
    要实现多个站点对应HTTPS只能更改IIS配置
    首先把每个站点分配个不同端口,如443.444.445…(证书一定要是多域的) 然后重启站点
    方法一:
    然后在:C:Windowssystem32inetsrvconfigapplicationHost.config
    找到
    <bindingprotocol="https" bindingInformation="*:443" />
    <binding protocol="https" bindingInformation="*:444"/>
    <binding protocol="https" bindingInformation="*:445"/>
    修改成:
    <binding protocol="https" bindingInformation="*:443:domain(对应的域名)" />
    <binding protocol="https" bindingInformation="*:443:domain" />
    <binding protocol="https" bindingInformation="*:443:domain" />
    切记需要对应的每个站点都修改。
    不要重启站点和整个IIS服务器,不然又需要重新操作一次上边的步骤!

    方法二:

    • 直接执行命令,添加443主机头
    • 找到站点对应的标识符,MetaBase.xml文件中对应站点的location路径w3svc/后的数字即为站点标识。
    • 根据需要可以分别为www和不带www或其他二级站点配置443主机头,打开cmd,执行命令:cscript.exe C:InetpubAdminScriptsadsutil.vbs set     /w3svc/1592095342/SecureBindings ":443:www.abc.com"
    • 测试访问。配置完成后,通过https对各站点进行访问,确认各站点正确跳转。
    注意事项
    注意:(1)确认adsutil.vbs的真实目录,一般为:C:InetpubAdminScripts; (2)示例中“1592095342”为站点标识符,”www.abc.com”为您要绑定443端口的主机头。 (3)443为https协议的缺省端口,即默认端口(如果为站点设置不同的SSL端口,则不需按照此文档配置主机头,直接https+域名+端口号访问即可。)
     
    原文:https://bbs.wosign.com/forum.php?mod=viewthread&tid=1668&highlight=IIS
  • 相关阅读:
    HDU 3757 Evacuation Plan DP
    UVa 1473
    LA 6047 Perfect Matching 字符串哈希
    HDU 3038 How Many Answers Are Wrong 并查集带权路径压缩
    专业程序员必知必会技巧:驯服复杂代码
    OpenCV、OpenCL、OpenGL、OpenPCL
    关于dlg和pro的问题
    关于编译PCL1.71
    VS2010编译错误:fatal error C1189: #error : This file requires _WIN32_WINNT to be #defined at least to 0x
    AI:从游戏引擎--到AI
  • 原文地址:https://www.cnblogs.com/zhaiyf/p/8567525.html
Copyright © 2011-2022 走看看