nginx https加密

來源:互聯網
上載者:User

標籤:nginx   https   

1,使用https保證機器上安裝了openssl和openssl-devel

        yum -y install openssl*

2,頒發認證給自己

openssl genrsa -des3 -out server.key 1024                     \\用於產生rsa私密金鑰檔案openssl req -new -key server.key -out server.csr               \\openssl req 用於產生認證請求openssl rsa -in server.key -out server_nopwd.key                \\利用openssl進行RSA為公開金鑰加密openssl x509 -req -days 365 -in server.csr -signkey server_nopwd.key -out server.crt3,添加nginx認證 server {        listen 443 ssl;ssl_certificate      /usr/local/nginx/ssl/server.crt;            //憑證路徑,卻對和相對路徑都可以        ssl_certificate_key  /usr/local/nginx/ssl/server_nopwd.key;}儲存退出nginx -t檢查出現nginx: [emerg] the "ssl" parameter requires ngx_http_ssl_module in /usr/local/nginx/conf/nginx.conf:99是nginx編譯的時候沒有增加這個ssl模組,從新編譯加上  --with-http_ssl_module

nginx https加密

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.