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

下面用SSH 登錄 進(jìn)入目錄 我的是N+A配置,所以我是進(jìn)入N 目錄。如果是A請自己找, 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;}}
其實我們只需要簡單增加兩行就可以了 listen 443 ssl;#監(jiān)聽端口ssl_certificate /www/ssl/dutuji.com.crt; #證書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
完畢, |