隨著大家對網(wǎng)站安全的重視,還有微信小程序開發(fā)的原因,大家都越來越重視網(wǎng)站SSL了…
當(dāng)前位置:網(wǎng)站首頁 > 幫助中心 > 正文
隨著大家對網(wǎng)站安全的重視,還有微信小程序開發(fā)的原因,大家都越來越重視網(wǎng)站SSL了。小編今天就給大家分享一下配置SSL的流程,并把非https跳轉(zhuǎn)到https域名上。
1. 申請SSL證書,本文用的是阿里云的免費(fèi)SSL證書,申請地址:https://common-buy.aliyun.com/?spm=5176.7968328.1266638..73dc1232tTWHHp&commodityCode=cas#/buy
2. 申請通過后,下載Nginx版本的證書文件,并上傳到服務(wù)器。
3. 新增加配置.conf文件
server {
listen 443;
server_name www.boncent.com;
ssl on;
root /www/web/boncent/public_html;
ssl_certificate /www/nginx/cert/1451280_www.boncent.com.pem;
ssl_certificate_key /www/nginx/cert/1451280_www.boncent.com.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 ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fcgi.conf;
}
location / {
root /www/web/boncent/public_html;
index index.php index.html;
}
}
4. 重啟Nginx,這步可以安排到第6步操作。
5. 編輯非https的配置文件,增加:
if ($host = "www.boncent.com") {
rewrite ^/(.*)$ https://www.boncent.com/$1 permanent;
}
讓非https域名強(qiáng)制跳轉(zhuǎn)到https域名上。
6. 重啟Nginx。
客服
熱線
133 9152 9507
7*24小時(shí)客服服務(wù)熱線