【发布时间】:2020-02-13 18:41:05
【问题描述】:
最近,当我在仪表板中登录我的网站时,我不断看到这个屏幕
如何防止这种情况发生?
我在 Nginx 上使用 CloudFlare。
我曾经使用过 Fail2Ban,但我禁用了它。
[nginx-req-limit]
enabled = false
filter = nginx-req-limit
action = iptables-multiport[name=ReqLimit, port="http,https", protocol=tcp]
jdoeddos
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 jdoe.com www.jdoe.com;
root /home/forge/jdoe/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;
}
}
有什么需要关闭的设置吗?
【问题讨论】:
-
您是否尝试过其他 IP 并重新启动网络服务器?也发布你的 nginx 配置
-
我记得在主要路线有效而其余路线无效的情况下遇到了这个问题。此问题与您的公用文件夹中的 .htaccess 文件有关。最简单的解决方案是创建一个新的 laravel 项目,采用该项目 .htaccess 并根据您的要求进行自定义。如果您需要进行任何更改,否则只需替换文件。 :) 保留备份,以防万一出现问题
标签: laravel nginx laravel-5 cloudflare fail2ban