Ошибка облачной вспышки 502 Bad Gateway - Nginx - Laravel5 - PullRequest
2 голосов
/ 17 октября 2019

В последнее время, как только я вошел на свой сайт в панель инструментов, я продолжал получать этот экран

Как мне предотвратить это?

Я использую CloudFlare поверх моего Nginx.

Раньше я использовал Fail2Ban, но я отключил it.

[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 Ответ

2 голосов
/ 22 октября 2019

изменить это

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

на

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