cloudflare免费证书_免费获取cloudflare的ssl证书

点击ssl 证书

选中 中间那个

保存文件 xxx.pem   一个 为xxx.key

server

{

listen 80;

#listen [::]:80;

server_name  xxx.net www.xxx.net;

index index.html index.htm index.php default.html default.htm default.php;

root  /home/wwwroot/xxx.net;

include rewrite/none.conf;

#error_page   404   /404.html;

# Deny access to PHP files in specific directory

#location ~ /(wp-content|uploads|wp-includes|images)/.*\.php$ { deny all; }

include enable-php.conf;

include rewrite/maccms.conf;

location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$

{

expires      30d;

}

location ~ .*\.(js|css)?$

{

expires      12h;

}

location ~ /.well-known {

allow all;

}

if ($host != 'www.xxx.net') {

rewrite ^/(.*)$ https://www.xx.net/$1 permanent;

}

if ($http_x_forwarded_proto != "https")

{

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

}

location ~ /\.

{

deny all;

}

access_log off;

}

server{

listen 443;

server_name   www.xx.net;

index index.html index.htm index.php default.html default.htm default.php;

root  /home/wwwroot/xxx.net;

ssl on;

ssl_certificate /usr/local/nginx/cert/xxx.net.pem;

ssl_certificate_key /usr/local/nginx/cert/xxx.net.key;

include rewrite/maccms.conf;

include enable-php-pathinfo.conf;

location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$

{

expires      30d;

}

location ~ .*\.(js|css)?$

{

expires      12h;

}

location ~ /.well-known {

allow all;

}

location ~ /\.

{

deny all;

}

access_log  /home/wwwlogs/xxx.log;

}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Cloudflare是一种网站加速和安全服务提供商,而WordPress是一种流行的内容管理系统。相互结合使用时,有时会遇到“err_too_many_redirects”错误。 这个错误通常发生在网站重定向设置出现问题时。当Cloudflare和WordPress同时配置了HTTPS,但是其重定向规则不匹配时,就会出现此错误。这可能是由于不正确的SSL设置、无限循环的重定向规则或其他参数设置不当导致的。 要解决这个问题,有几个步骤可以尝试: 首先,确保你的WordPress网站和Cloudflare都配置了正确的SSL设置,例如使用相同的SSL/TLS选项和相同的URL设置。确保WordPress设置中的网址与Cloudflare中的网址匹配。 其次,检查你的重定向规则是否设置正确。在WordPress设置中,打开“常规设置”并确保WordPress地址和站点地址正确。在Cloudflare中,检查“SSL/TLS”选项页面和“网页规则”页面,确保重定向规则设定正确。 还要检查Cloudflare中的缓存设置。如果启用了“全站缓存”,可以尝试禁用它,然后在WordPress设置中手动清除缓存。有时这可以解决“err_too_many_redirects”错误。 如果以上步骤没有解决问题,可以尝试禁用所有的插件和主题,然后逐个重新启用,以查找是否有某个插件或主题导致了重定向循环。 最后,如果仍然无法解决问题,建议查看WordPress和Cloudflare的官方文档和论坛,以获取更多关于此错误的详细解答和可能的解决方案。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值