超碰中文网,91久久精品日日躁夜夜躁欧美,一区二区三区精品道,一区二区国产在线观看,亚洲精品中文字幕乱码一区二区,天天看片高清影视在线观看,久久99精品久久久久蜜桃,久久成人影视

VPS參考測評推薦
專注分享VPS主機優惠信息
衡天云優惠活動
熱網互聯2026年促銷活動
hostkvm優惠促銷活動
zji優惠促銷活動
QQGNET優惠促銷活動
QQGNET優惠促銷活動

Nginx構建https服務器的教程

主機參考:VPS測評參考推薦/專注分享VPS服務器優惠信息!若您是商家可以在本站進行投稿,查看詳情!此外我們還提供軟文收錄、PayPal代付、廣告贊助等服務,查看詳情!
我們發布的部分優惠活動文章可能存在時效性,購買時建議在本站搜索商家名稱可查看相關文章充分了解該商家!若非中文頁面可使用Edge瀏覽器同步翻譯!PayPal代付/收錄合作

HTTPS的主要功能可以分為兩種:一種是建立信息安全通道,保證數據傳輸的安全;另一個是確認網站的真實性。可以根據自己的需求選擇購買SSL證書。接下來SSL證書申請指南分享Nginx關于搭建https服務器的教程。

1.創建SSL證書

1.1私鑰的產生,OpenSSL gen RSA-des 3-out xn2.lqb.com.key 2048。該命令將生成一個2048位RSA私鑰。使用DES3算法,私鑰文件名可以任意命名。只需在Nginx配置中指定文件路徑,系統會提示設置私鑰密碼。請設置密碼并牢記在心。

[root @ Monitorssl]# OpenSSL genrsa-des 3-outx N2 . lqb . com 2048 generating rsaprivatekey,2048bitlongmodulus & # 8230…………………………。+++ ………………………………………………。+++EIS 65537(0x 010001)enterpassphraseforxn 2 . lqb . com:驗證-Enterpassphraseforxn2.lqb.com:

1.2上面產生的密鑰有密碼。如果密碼被刪除,執行以下命令OpenSSL RSA-in xn2.lqb.com-outxn2.lqb.com _ no pwd . key

[root @ monitor SSL]# ls xn2.lqb.com[root @ monitor SSL]# opensslrsa-in xn 2 . lqb . com-outx N2 . lqb . com _ no pwd . key enterpassphraseforxn 2 . lqb . com:writing RSA key

1.3從生成的私鑰生成證書請求文件CSR。OpenSSL RSA-in xn2.lqb.com-out xn2 . lqb . com _ no pwd . key

[root @ Monitorssl]# opensslrsa-in xn 2 . lqb . com-outx N2 . lqb . com _ no pwd . key enterpassphraseforxn 2 . lqb . com:writing rsakey[root @ Monitorssl]# opensslreq-new-keyxn2.lqb.com-outxn2.lqb.com.csr enterpassphraseforxn 2 . lqb . com:youreabouttobetoaskedtoenterinformations將被納入您的rtificaterequest。whateyoureaboutto interriswhatiscalleddistinguishednameoradn。如果輸入& # 8217;則需要幾個fieldsbutyoucanleavesomebank for somefieldsherewillbeadefaultvalue。。’,thefieldwillbeleftblank。—–country name(2 letter code)[AU]:CN State or province name(full name)[Some-State]:上海LocalityName(如,city)[]:上海OrganizationName(如,company)[internetwidgistptyltd]:xn2 . lqb . com organization alunitname(如,section)[]:IT CommonName(如,serverfqdnoryourname)[]:xn2 . lqb . com EmailAddress[]:2223344@qq.com Pleaseenterthefollowing & # 8217;extra & # 8217attributes tosentwithyourcertificaterequest Achallengepassword[]:anoptioncompanyname[]:[root @ Monitorssl]# ls xn2 . lqb . com xn2 . lqb . com . csrxn2 . lqb . com _ no pwd . key

1.4.證書請求文件CSR文件必須由CA簽名才能形成證書。你可以把這個CSR發到StartSSL(免費)、verisign(一大筆錢)等地方讓他驗證。也可以自己做CA,自己發證書。創建自簽名CA證書。OpenSSL req-new-x509-days 3650-key xn2.lqb.com-out xn2.lqb.com.crt

[root @ Monitorssl]# opensslreq-new-x509-days 3650-keyxn 2 . lqb . com-out xn 2 . lqb . com . CRT xn 2 . lqb . com . csrxn 2 . lqb . com _ no pwd . key[root @ Monitorssl]# opensslreq-new-x509-days 3650-keyxn 2 . lqb . com _ no pwd . key-out xn 2 . lqb . com . CRTwhateyoureaboutto interriswhatiscalleddistinguishednameoradn。如果輸入& # 8217;則需要幾個fieldsbutyoucanleavesomebank for somefieldsherewillbeadefaultvalue。。’,thefieldwillbeleftblank。—–country name(2 letter code)[AU]:CN State or province name(full name)[Some-State]:上海LocalityName(如,city)[]:上海OrganizationName(如,company)[internetwidgistptyltd]:lqb . com OrganizationalUnitName(如,section)[]:IT CommonName(如,serverfqdnoryourname)[]:xn2 . lqb . com email address[]:[root @ Monitorssl]# ls xn2 . lqb . com xn 2 . lqb . com . crqb . com

2.配置nginx虛擬主機文件

[root@Monitorssl]#vim../server . conf server { listen 80;server _ name xn 2 . lqb . com;root/html/xn2;#rewrite^/(.*)$ https:xn3 . lqb . com/$ 1 permanent;地點/{ indexindex.html;# proxy _ cachemycache# proxy _ cache _ valid2003h# proxy _ cache _ valid30130210m# proxy _ cache _ validall1m# proxy _ cache _ use _ staleerrortimeouthttp _ 500 http _ 502 http _ 503;# # proxy _ pass http://192 . 168 . 180 . 9;# proxy _ set _ headerHost $ host# proxy _ set _ headerX-Real-IP $ remote _ addr;}地點/圖片/{ indexindex.html;} }服務器{ listen *:443;server _ name xn 2 . lqb . com;sslon# # # bit虛擬主機開放ssl支持SSL _ certificate/usr/local/nginx/conf/server/SSL/xn2 . lqb . com . CRT;# # #為虛擬主機指定簽名證書文件SSL _ certificate _ key/usr/local/nginx/conf/server/SSL/xn2 . lqb . com _ no pwd . key;# # #指定虛擬主機的私鑰文件# # ssl _ session _ timeout5m# # # #客戶端可以重用緩存中存儲的會話參數time root/html/xn3;位置/圖片/{ indexindex.html;} location/{ proxy _ pass http://192 . 168 . 180 . 23;proxy _ set _ headerHost $ hostproxy _ set _ headerX-Real-IP $ remote _ addr;} }

這幾篇文章你可能也喜歡:

本文由主機參考刊發,轉載請注明:Nginx構建https服務器的教程 http://m.k2270.com/86280.html

【騰訊云】領8888元采購禮包,搶爆款云服務器 每月 9元起,個人開發者加享折上折!
打賞
轉載請注明原文鏈接:主機參考 » Nginx構建https服務器的教程
主機參考僅做資料收集,不對商家任何信息及交易做信用擔保,購買前請注意風險,有交易糾紛請自行解決!請查閱:特別聲明

評論 搶沙發

評論前必須登錄!