windows2008+iis7 environment SSL deployment https certificate (single/multi-site)

Published: 2017-03-23

```html

For deploying an SSL certificate for a Hong Kong IP in the 亚数机房 data center, please click to refer to this tutorial

A. Deploy HTTPS for single/multiple sites with SSL on Linux systems

B. Deploy HTTPS for a single site with SSL on Windows2003 systems

C. Deploy HTTPS certificate on win2012+iis8 (supports multiple sites)

Set up a 301 redirect after deploying HTTPS (SSL) to redirect HTTP to HTTPS


Notes

  1. Before deployment, please exit the antivirus software installed on the server (security software such as 360, 金山, and 安全狗 may cause SSL certificate deployment errors)

  2. This tutorial is mainly for SSL certificates applied for through our company. If you do not yet have an SSL certificate, please click to apply,Certificates applied for through other companies may differ. If deployment fails, you need to troubleshoot by yourself, or submit a proper ticket and our company will troubleshoot for a fee.

  3. Please make relevant backups before deployment. If you deploy by yourself and it fails, we do not assume the relevant risks and responsibilities.


1. Our company's 建站助手 deploys multi-site certificates using Nginx reverse proxy (win2008 supports only the single-site method windows2008+iis7)

    1. Update 建站助手 to the latest version 4.2 (opening 建站助手 will automatically prompt an upgrade)

    2. Create the site in 建站助手 (if the site has already been created, you can ignore this step)

    1.jpg

   3. Refer to the following method and click “Manage Nginx” to install the Nginx service (if security software such as 安全狗 or 云锁 is installed, please exit it before installation; otherwise installation may fail)

   2222.jpg

  3. After the Nginx certificate is installed, please click “Upload SSL Domain Certificate” to start deployment (there are two methods: file deployment and pasting the certificate file contents; please choose according to your situation)

  33.jpg

  4. After performing the operations shown above, certificate deployment is complete, and you can then access it via HTTPS. If you want to update the SSL certificate, please double-click a domain name and follow the operations shown in the figure below.

4444.jpg

At this point, the method of deploying certificates using Nginx in 建站助手 is complete.


2. Method for deploying multiple sites by manually creating sites in IIS7 (windows2008+iis7+nginx)

Note: This method applies to win2008+iis7 and sites created manually (not created using our company's 建站助手).

Description: Because IIS 7 does not support deploying HTTPS for multiple sites, you can implement it using Nginx + IIS 7 reverse proxy. If you are not clear about how to deploy, we recommend submitting a ticket: [Host Rental/vps, Cloud Host] -> [Site Settings] -> Configure HTTPS, and our company will deploy it for you.


Download Script & Run 

     [Special Note: Previously, nwin-ssl.bat was used to install the reverse proxy environment, that is, deploy HTTPS through a web page; the current new script is not applicable.]

     1. Download the win-ssl.bat script file from a browser inside the server, and double-click to run the bat file. It will automatically prompt you to download the wget.exe file and install Nginx as shown in the figure (the wget.exe file must be placed in the same directory as the bat script)

     1111.jpg

     2. After installation is complete, open the script and deploy the certificate as shown in the figure (if there are errors, please resolve them according to the error prompts; you can also submit a ticket and we will handle it manually, which will involve a fee)

     2121.jpg   

    3. After deployment is complete, you can access the site via HTTPS.

     333.jpg


Set Up 301 Redirect

Method 1: Add the following code to the Nginx site configuration file

server

{

        listen 80;

        server_name abc.com;

        rewrite ^(.*) https://www.abc.com$1 permanent;           # Replace abc.com with your own domain name   

}


Method 2: Add the following code to web.config

<?xml version="1.0" encoding="UTF-8"?>

<configuration>

 <system.webServer>

        <rewrite>

            <rules>

               <rule name="301" stopProcessing="true">

                    <match url="^(.*)$" ignoreCase="false" />

                    <conditions logicalGrouping="MatchAll">

                        <add input="{HTTP_FROM_HTTPS}" pattern="^on$" negate="true" />

                    </conditions>

                    <action type="Redirect" url="https://www.abc.com/{R:1}" redirectType="Permanent" />     # Replace www.abc.com with your own domain name

               </rule>

            </rules>

        </rewrite>

    </system.webServer> 

</configuration>


Please choose the corresponding reference document below according to the operating system and the number of deployed sites. The document is for reference only. If you are not familiar with the technology, we recommendsubmitting a ticket, and our company's engineers will help you configure it (a fee will be incurred).

Other Notes

  • Nginx reverse proxy does not affect previous website settings such as pseudo-static/301, nor does it affect access to non-HTTPS sites.

  • If you are a 智能多线 user, you need to resolve the domain name to the server IP using an A record.

The above content comes from the Internet and is for reference only.

```