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

來源:互聯網
上載者:User

標籤:how to moving ssl certificate(https)from iis to nginx

因為業務需要,需將將一原IIS下的https網站遷移到nginx前端反向 Proxy的架構中。

具體步驟為:

  1. 在IIS所在的Windows伺服器上匯出認證.

    1) 【開始】--->【運行】---> MMC

    2) 【添加】--->【認證】--->添加

    3) 選擇【電腦帳號】--->NEXT

    4) 選擇【本機電腦】--->OK

    5) 【關閉】--->【確定】

    6) 依次展開【認證】--->【個人認證】

    7) 右鍵選擇你想匯出的認證

    8) 【所有任務】--->【匯出】

    9) 按照提示匯出一個pfx檔案比如 sslcert.pfx

  2. 把pfx檔案上傳到nginx所在的linux伺服器上,

    1) 匯出Private key 

    openssl pkcs12 -in [sslcert].pfx -nocerts -out key.pem

    2) 從私人key中將密碼remove(在1.9中匯出pfx的時候會提示輸入一個密碼來保護這個pfx)

    openssl rsa -in key.pem -out server.key

    3) 匯出認證

    openssl pkcs12 -in [sslcert].pfx -clcerts -nokeys -out cert.pem

  3. 將上述得到的cert.pem;server.key複製到需要的目錄中,比如/etc/nginx/conf.d/ssl/中

  4. 編輯test.com.conf(nginx的server的conf)


  5. server { listen 443; server_name www.test.com; ssl on; ssl_certificate /etc/nginx/conf.d/ssl/ cert.pem; ssl_certificate_key /etc/nginx/conf.d/ssl/server.key;   location /{ proxy_pass http://test.com_server_pool; } }


本文出自 “skybug” 部落格,請務必保留此出處http://skybug.blog.51cto.com/132577/1610877

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

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.