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

问题描述 投票:0回答:1

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

“”

动画

“”

如何预防?

我正在Nginx上使用CloudFlare。

我曾经使用Fail2Ban,但我disabled

[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;
    }

}

我需要关闭任何设置吗?

laravel nginx laravel-5 cloudflare fail2ban
1个回答
0
投票

更改此

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;
    }

to

location ~ \.php$ {
                try_files $uri =404;
                fastcgi_split_path_info ^(.+\.php)(/.+)$;
                fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
                fastcgi_index index.php;
                fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                include /etc/nginx/fastcgi_params;
        }
© www.soinside.com 2019 - 2024. All rights reserved.