linux免費https證書申請教程
直接去阿里雲 菜單有個證書服務
進去有個購買證書菜單 選擇免費的 然后會提示寫個人資料 然后系統生成csr 然后提交審核
這個時候會有份郵件 文件下載上傳到你的服務器 驗證 (因為我用的是文件驗證方式)
審核通過后 阿里雲后台證書服務 里可以下載證書啦
解壓上傳到nginx目錄conf mkdir cert 證書文件上傳上去 如圖下
<img src="http://newmiracle.cn/wp-content/uploads/2017/01/QQ截圖20170112135059-300x94.png" alt="QQ截圖20170112135059" width="300" height="94" class="alignnone size-medium wp-image-1007" />
接下來改nginx.conf配置
添加個443端口 因為https是443端口 然后證書路徑改下就Ok nginx -s reload重啟
<pre>
server {
listen 443;
server_name www.newmiracle.cn newmiracle.cn;
ssl on;
charset utf-8;
index index.html index.htm;
ssl_certificate cert/213996993440360.pem;
ssl_certificate_key cert/213996993440360.key;
ssl_session_timeout 5m;
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
location / {
root /home/www/wordpress;
index index.php index.html index.htm;
}
location ~ \.php$ {
root /home/www/wordpress;
#fastcgi_pass 127.0.0.1:9000;
#fastcgi_pass 127.0.0.1:9001;
fastcgi_pass unix:/dev/shm/php-cgi.sock;
fastcgi_index index.php;
#try_files $uri =404;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
</pre>
然后https://newmiracle.cn可以訪問啦 ps:如果訪問是直接下載 那過幾個小時看看吧 可能沒更新