環(huán)境
系統(tǒng)環(huán)境:CentOS6.7
nginx version: nginx/1.8.1
證書
# ls /opt/nginx/conf/sslqingkang.me.crt # 公鑰qingkang.me.key # 私鑰
配置
vim nginx.conf
找到以下內(nèi)容
# HTTPS server##server {# listen 443 ssl;# server_name localhost;# ssl_certificate cert.pem;# ssl_certificate_key cert.key;# ssl_session_cache shared:SSL:1m;# ssl_session_timeout 5m;# ssl_ciphers HIGH:!aNULL:!MD5;# ssl_prefer_server_ciphers on;# location / {# root html;# index index.html index.htm;# }#}
修改為:
server { listen 443 ssl; server_name qingkang.me; ssl_certificate ssl/qingkang.me.crt; ssl_certificate_key ssl/qingkang.me.key; ssl_session_cache shared:SSL:1m; ssl_session_timeout 5m; ssl_ciphers HIGH:!aNULL:!MD5; ssl_prefer_server_ciphers on; location / { root html; index index.html index.htm; } }
檢查配置
/opt/nginx/sbin/nginx -t
重啟Nginx生效
/opt/nginx/sbin/nginx -s reload
總結(jié)
以上就是這篇文章的全部?jī)?nèi)容了,希望本文的內(nèi)容對(duì)大家的學(xué)習(xí)或者工作能帶來(lái)一定的幫助,如果有疑問大家可以留言交流,謝謝大家對(duì)VEVB武林網(wǎng)的支持。
新聞熱點(diǎn)
疑難解答
圖片精選