四虎影视在线影院在线观看,小s货再浪些再咬紧点h,国产精品水嫩水嫩,97精产国品一二三产区

Board logo

標(biāo)題: [教程] 貼一下wdcp nginx的https配置文件,大家看看有沒有問題,目前運(yùn)行正常 [打印本頁]

作者: qushuiyouhan    時間: 2017-2-24 21:52     標(biāo)題: 貼一下wdcp nginx的https配置文件,大家看看有沒有問題,目前運(yùn)行正常

本帖最后由 qushuiyouhan 于 2017-2-24 21:58 編輯

貼一下wdcp nginx的https配置文件,大家看看有沒有問題,目前運(yùn)行正常!
1、首先必須是有2個server 的 一個定義 80 端口 一個定義443。
2、其次,80端口 做了重定向 ,將http強(qiáng)制轉(zhuǎn)向https:

rewrite ^(.*)$  https://$host$1 permanent;
return 301 https://$host$request_uri;

3、代碼如下:
  1. server {
  2.         listen       80;
  3.         rewrite ^(.*)https://$host$1 permanent;
  4.         return 301 https://$host$request_uri;
  5.         root /www/web/xxx/public_html;
  6.         server_name www.xxx.com www.xxx.com;
  7.         index index.html index.php index.htm;
  8.         error_page  400 /errpage/400.html;
  9.         error_page  403 /errpage/403.html;
  10.         error_page  404 /errpage/404.html;
  11.         location ~ \.php$ {
  12.                 fastcgi_pass   127.0.0.1:9000;
  13.                 fastcgi_index  index.php;
  14.                 include fcgi.conf;
  15.         }
  16.         location ~ /\.ht {
  17.                 deny  all;
  18.         }
  19.         include /www/wdlinux/wdcp/rewrite/xxx.conf;
  20. }

  21.         

  22. server {
  23.         listen 443 ssl;
  24.         ssl_certificate /www/ssl/xxx.com.crt;
  25.         ssl_certificate_key /www/ssl/xxx.com.key;
  26.         ssl_session_timeout 5m;
  27.         root /www/web/sun0391/public_html;
  28.           server_name www.xxx.com www.xxx.com;
  29.         index index.html index.php index.htm;
  30.         error_page  400 /errpage/400.html;
  31.         error_page  403 /errpage/403.html;
  32.         error_page  404 /errpage/404.html;
  33.         location ~ \.php$ {
  34.                 fastcgi_pass   127.0.0.1:9000;
  35.                 fastcgi_index  index.php;
  36.                 include fcgi.conf;
  37.         }
  38.         location ~ /\.ht {
  39.                 deny  all;
  40.         }
  41.         include /www/wdlinux/wdcp/rewrite/xxx.conf;
  42. }
復(fù)制代碼





歡迎光臨 WDlinux官方論壇 (http://cd-genova.com/bbs/) Powered by Discuz! 7.2