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

Published: 2017-03-23

```html

To deploy an SSL certificate for a Hong Kong IP in Asia Data Center, please click to refer to this tutorial

A, linux system SSL deployment HTTPS single/multiple sites

B, windows2003 system SSL single-site deployment of https

C, win2012+iis8 deploy https certificate (supports multiple sites)

After deploying https(ssl), set up a 301 redirect to redirect http to https


Notes

  1. Before deployment, please exit the antivirus software installed on the server (security software such as 360, Kingsoft, SafeDog, etc. 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 from other companies may differ. If deployment fails, you need to troubleshoot it yourself, or submit a correct ticket and our company will troubleshoot for a fee.

  3. Before deployment, please make relevant backups. If self-deployment fails, we do not assume related risks and responsibilities.


I. Our company's Website Building Assistant uses nginx reverse proxy to deploy multi-site certificates (win2008 only supports the one-site method windows2008+iis7)

    1. Update the Website Building Assistant to the latest version 4.2 (opening the Website Building Assistant will automatically prompt for upgrade)

    2. Create the site in the Website Building Assistant (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 SafeDog, Yunsuo, etc. is installed, please exit it before installation; otherwise installation may fail)

   2222.jpg

  3. After the nginx certificate installation is complete, please click "Upload SSL Domain Certificate" to start deployment (there are two methods: file deployment and pasting certificate file content; please choose according to your own situation)

  33.jpg

  4. After operating as shown in the figure above, the certificate deployment is complete, and you can then use https to access it. If you want to update the ssl certificate, please double-click a domain name and follow the operation shown in the figure below,

4444.jpg

At this point, the method of deploying a certificate using nginx in the Website Building Assistant is complete.


II. Method for manually creating sites in IIS7 to deploy multiple sites (windows2008+iis7+nginx)

Note: This method applies to win2008+iis7 and sites created manually (not created using our company's Website Building Assistant)

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


Download Script & Run 

     [Special Note: The previous use of nwin-ssl.bat to install the reverse proxy environment, i.e., deploying https through the web page method, is not applicable to the current new script]

     1. In a browser inside the server, download the win-ssl.bat script file. Double-click to run the bat file; it will automatically prompt 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, you can open the script and deploy the certificate as shown in the figure (if there is an error, please resolve it according to the error prompt, or you can submit a ticket and we will handle it manually; fees will be involved)

     2121.jpg   

    3. After deployment is complete, you can access the site using 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;           # Modify abc.com to 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" />     # Modify www.abc.com to your own domain name

               </rule>

            </rules>

        </rewrite>

    </system.webServer> 

</configuration>


Please choose the corresponding reference document below according to the operating system and number of site deployments. The document is for reference only, if you are not familiar with the technology, it is recommended tosubmit a ticket, and our company's engineers will help you configure it (fees will be incurred).

Other Notes

  • Nginx reverse proxy does not affect previous website pseudo-static/301 and other settings, nor does it affect access to non-https sites

  • If you are a Smart Multi-Line 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.

```