本站經(jīng)過(guò)多次嘗試,可以使用SSL(https://www.dutuji.com)或者是普通訪問(wèn)(http://www.dutuji.com) 請(qǐng)各位大俠路過(guò),這個(gè)博客為小白博客,禁不起風(fēng)吹雨打(DDCC),請(qǐng)高抬貴手,民工在這里謝謝了 本站配置為騰訊云+centos +wdcp+ssl 標(biāo)準(zhǔn)的小白配置 先申請(qǐng)SSL https://www.dutuji.com/host/server/364.html 教程這里(中國(guó)沃通) 然后是VPS 配置 下載證書(shū)我就不說(shuō)了。這里我用ssh ftp 登錄。 然后在www/里面建立一個(gè)文件夾:ssl。 把證書(shū)上傳,就是你看到的這個(gè)ssl 目錄里面

下面用SSH 登錄 進(jìn)入目錄 我的是N+A配置,所以我是進(jìn)入N 目錄。如果是A請(qǐng)自己找, server {listen 80;server_name www.dutjji.com dutuji.com; #我是以本站作為例子,root /www/web/dutuji.com/public_html; index index.html index.php index.htm;error_page 400 /errpage/400.html;error_page 403 /errpage/403.html;error_page 404 /errpage/404.html;error_page 405 /errpage/405.html;location ~ \.php$ {fastcgi_pass 127.0.0.1:9000;fastcgi_index index.php;include fcgi.conf;}}
其實(shí)我們只需要簡(jiǎn)單增加兩行就可以了 listen 443 ssl;#監(jiān)聽(tīng)端口ssl_certificate /www/ssl/dutuji.com.crt; #證書(shū)ssl_certificate_key /root/dutuji.com.key; #網(wǎng)站密匙
完整的代碼: server {listen 80;listen 443 ssl;server_name www.dutuji.com dutji.com ;ssl_certificate /www/ssl/dutji.com.crt;ssl_certificate_key /www/ssl/dutuji.com.key;root /www/web/dutuji.com/public_html;index index.html index.php index.htm;error_page 400 /errpage/400.html;error_page 403 /errpage/403.html;error_page 404 /errpage/404.html;error_page 405 /errpage/405.html;location ~ \.php$ {fastcgi_pass 127.0.0.1:9000;fastcgi_index index.php;include fcgi.conf;}}這是配置好的圖片,i 插入,復(fù)制粘貼,然后再ESC +:wq 保存, 
重啟Nginx 命令:service nginxd restart
完畢, |