Cloudflare错误502错误网关-Nginx-Laravel5

时间:2019-10-16 22:33:12

标签: laravel nginx laravel-5 cloudflare fail2ban

最近,当我在仪表板中登录网站后,便一直显示此屏幕

如何防止这种情况?

我在Nginx上使用CloudFlare。

我曾经使用过Fail2Ban,但我禁用了

[nginx-req-limit]

enabled   = false
filter    = nginx-req-limit
action    = iptables-multiport[name=ReqLimit, port="http,https", protocol=tcp]
        bhengddos
logpath   = /var/log/nginx/default-error.log
findtime  = 10
bantime   = 7200
maxretry  = 20

Nginx

#limit_req_zone $binary_remote_addr zone=mylimit:10m rate=10r/s;

server {
    listen 80 default_server;
    server_name bunlongheng.com www.bunlongheng.com;
    root /home/forge/bheng/public;



    ssl_protocols TLSv1 TLSv1.1 TLSv1.2;

    index index.html index.htm index.php;

    charset utf-8;




    location / {
        #limit_req zone=one burst=2 nodelay;
        try_files $uri $uri/ /index.php?$query_string;
        add_header 'Access-Control-Allow-Origin' '*';
    }

    location ~ \.php$ {
        #limit_req zone=one burst=2 nodelay;
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
        fastcgi_index index.php;
        include fastcgi_params;
    }



    access_log off;
    error_log  /var/log/nginx/default-error.log error;

    error_page 404 /index.php;



    location ~ /\.ht {
        deny all;
    }

}

我需要关闭任何设置吗?

1 个答案:

答案 0 :(得分:3)

更改此

git fetch

location ~ \.php$ {
        #limit_req zone=one burst=2 nodelay;
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
        fastcgi_index index.php;
        include fastcgi_params;
    }