參考: http://www.itdecent.cn/p/6db0c6dc97a9
http和https的區(qū)別。感謝大神的筆記參考。
簡單的ssl證書配置實(shí)現(xiàn)https訪問。
服務(wù)器環(huán)境:
阿里云服務(wù)器ECS linux版本 CentOS 7.4 64位,已安裝nginx。
已購買認(rèn)證以及備案的域名: 例如:baidu.com
1:申請證書;具體詳情參考: https://yq.aliyun.com/articles/637307
2:配置nginx配置文件;

nginx.conf
3:保存并測試nginx;輸入命令: nginx -t
nginx: nginx: [emerg] unknown directive "ssl" in /usr/local/nginx/conf/nginx.conf...
解決方式:
1> 進(jìn)入nginx的壓縮目錄;輸入命令:cd /usr/local/src/nginx-1.14.0/
2> 從新安裝http-ssl模塊;輸入命令: ./configure --with-http_ssl_module
如果出現(xiàn)異常請先執(zhí)行命令: yum -y install openssl openssl-devel,再執(zhí)行。./cinfigure....命令;
3> 完成后執(zhí)行make;(不是make install)
4> 執(zhí)行命令拷貝替換;cp objs/nginx /usr/local/nginx/sbin/nginx
5> 檢測nginx -t;
4:成功后重啟nginx即可。

效果圖