LNMP配置SSL安全性憑證

來源:互聯網
上載者:User

標籤:

文章來源:http://my.oschina.net/rain21/blog/472423


這裡用到的是沃通wosign的免費數位憑證

申請地址:https://buy.wosign.com/


第一步:將下載的認證檔案for Nginx.zip中的

1_ssl.zy62.com_bundle.crt  和  2_ssl.zy62.com.key 上傳到root目錄下,並將其改名為  ssl.crt和ssl.key


第二步:

openssl rsa -in ssl.key -out /root/ssl.key

chmod 600 /root/ssl.key


第三步:修改vhost配置

server    {        listen 80;listen 443 ssl;        #listen [::]:80;ssl on;        ssl_certificate /root/ssl.crt;        ssl_certificate_key /root/ssl.key;        server_name ssl.zy62.com;        index index.html index.htm index.php default.html default.htm default.php;        root  /home/wwwroot/ssl.zy62.com;        include none.conf;        #error_page   404   /404.html;        location ~ [^/]\.php(/|$)        {            # comment try_files $uri =404; to enable pathinfo            try_files $uri =404;            fastcgi_pass  unix:/tmp/php-cgi.sock;            fastcgi_index index.php;            include fastcgi.conf;            #include pathinfo.conf;        }        location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$        {            expires      30d;        }        location ~ .*\.(js|css)?$        {            expires      12h;        }        access_log  /home/wwwlogs/ssl.zy62.com.log  access;    }


最後 lnmp restart 重啟就好了



LNMP配置SSL安全性憑證

聯繫我們

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