标题:
[教程]
贴一下wdcp nginx的https配置文件,大家看看有没有问题,目前运行正常
[打印本页]
作者:
qushuiyouhan
时间:
2017-2-24 21:52
标题:
贴一下wdcp nginx的https配置文件,大家看看有没有问题,目前运行正常
本帖最后由 qushuiyouhan 于 2017-2-24 21:58 编辑
贴一下wdcp nginx的https配置文件,大家看看有没有问题,目前运行正常!
1、首先必须是有2个server 的 一个定义 80 端口 一个定义443。
2、其次,80端口 做了重定向 ,将http强制转向https:
rewrite ^(.*)$ https://$host$1 permanent;
return 301 https://$host$request_uri;
3、代码如下:
server {
listen 80;
rewrite ^(.*)https://$host$1 permanent;
return 301 https://$host$request_uri;
root /www/web/xxx/public_html;
server_name www.xxx.com www.xxx.com;
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;
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fcgi.conf;
}
location ~ /\.ht {
deny all;
}
include /www/wdlinux/wdcp/rewrite/xxx.conf;
}
server {
listen 443 ssl;
ssl_certificate /www/ssl/xxx.com.crt;
ssl_certificate_key /www/ssl/xxx.com.key;
ssl_session_timeout 5m;
root /www/web/sun0391/public_html;
server_name www.xxx.com www.xxx.com;
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;
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fcgi.conf;
}
location ~ /\.ht {
deny all;
}
include /www/wdlinux/wdcp/rewrite/xxx.conf;
}
复制代码
欢迎光临 WDlinux官方论坛 (http://wdlinux.cn/bbs/)
Powered by Discuz! 7.2