How to Moving SSL Certificate (HTTPS) from IIS to Nginx

Source: Internet
Author: User
Tags openssl rsa pkcs12 nginx server ssl certificate pfx file

Because of business needs, you need to migrate an HTTPS site under the original IIS to the Nginx front-end reverse proxy architecture.

The specific steps are:

  1. Export the certificate on the Windows server where IIS resides.

    1) "Start"---> "Run"---> MMC

    2) "Add"---> "certificates"---> Add

    3) Select "Computer Account"--->next

    4) Select "Local Computer"--->ok

    5) "Close"---> "OK"

    6) Expand Certificates---> Personal certificates

    7) Right-click the certificate you want to export

    8) "All Tasks"---> "Export"

    9) Follow the prompts to export a PFX file such as Sslcert.pfx

  2. Upload the PFX file to the Linux server on which Nginx resides,

    1) Export Private key

    OpenSSL pkcs12-in [Sslcert].pfx-nocerts-out Key.pem

    2) Remove the password from the private key (when exporting PFX in 1.9, you will be prompted for a password to protect the PFX)

    OpenSSL rsa-in key.pem-out Server.key

    3) Export Certificate

    OpenSSL pkcs12-in [Sslcert].pfx-clcerts-nokeys-out Cert.pem

  3. Copy the resulting cert.pem;server.key into the desired directory, such as in/etc/nginx/conf.d/ssl/

  4. Edit test.com.conf (Nginx server's conf)


  5. server {listen 443; server_name www.test.com; SSL on; SSL_CERTIFICATE/ETC/NGINX/CONF.D/SSL/CERT.PEM; Ssl_certificate_k   Ey/etc/nginx/conf.d/ssl/server.key; Location/{proxy_pass http://test.com_server_pool;}}


This article is from the "Skybug" blog, make sure to keep this source http://skybug.blog.51cto.com/132577/1610877

How to Moving SSL Certificate (HTTPS) from IIS to Nginx

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.