設置ssl網頁加密的方法:
1.下載證書,并上傳到服務器。
2.打開網站目錄,找到usr/local/Nginx/conf下的"xxx.conf"這個文件。(xxx是你的域名前綴)
3.打開文件并添加以下內容:
listen 443 ssl http2;
ssl_certificate /usr/local/nginx/conf/ssl/www.neiyidaogou.com.crt;
ssl_certificate_key /usr/local/nginx/conf/ssl/www.neiyidaogou.com.key;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers EECDH+CHACHA20:EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:EECDH+3DES:RSA+3DES:!MD5;
ssl_prefer_server_ciphers on;
ssl_session_timeout 10m;
ssl_session_cache builtin:1000 shared:SSL:10m;
ssl_buffer_size 1400;
add_header Strict-Transport-Security max-age=15768000;
ssl_stapling on;
ssl_stapling_verify on;
4.重啟nginx,使ssl配置生效即可。