加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 运营中心 > Nginx > 正文

ubuntu – Nginx:随机用户得到“找不到服务器”

发布时间:2020-12-13 21:10:03 所属栏目:Nginx 来源:网络整理
导读:我最近使用一些PHP和Django站点从apache切换到nginx / php-fpm.在某些时候,一些用户开始报告他们无法访问网站并获得“找不到服务器”.他们说: Im trying to open the website from my computer and get server not found. If I go through other computer a

我最近使用一些PHP和Django站点从apache切换到nginx / php-fpm.在某些时候,一些用户开始报告他们无法访问网站并获得“找不到服务器”.他们说:

I’m trying to open the website from my computer and get “server not found”. If I go through other computer at work,or through my phone,everything is fine. My IP is: xxx.xxx.xxx.xxx

我在错误日志中使用grep来查找那些IP,但什么也没得到.看来,当用户被这种方式“阻止”时,他再也无法访问网站了 – 它本身并没有得到治愈.另一方面,每天有超过30,000人访问这些网站,没有任何问题.

这些被阻止的东西似乎没有什么特别之处 – 它们使用不同的浏览器,拥有不同的子网.它没有任何意义.

你能就如何诊断和解决这个问题提出任何建议吗?

我的一个配置是:

server {
    server_name example.net;
    root /var/www/example/httpdocs;
    index index.php;
    charset utf-8;
    error_log /var/www/example/nginx_error.log;

    # banned users
    include /var/www/example/ban.conf;

    # rewrite rule
    location / {
        if (!-e $request_filename) {
            rewrite ^(.*)$/index.php?path=$1 last;
        }
    }

    location /admin {
        auth_basic "Restricted";
        auth_basic_user_file  /var/www/example/chronicler/htpasswd;
    }

    # including file with PHP related configuration parameters
    include php_support;
}

ban.conf内容:

deny 178.49.145.133;
deny 109.237.124.172;
deny 95.24.207.110;

IpTables命令:

sudo iptables -L -n

Chain INPUT (policy ACCEPT)
target     prot opt source               destination         

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination         

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination 

UPDATE

问题是我的托管服务提供商的防火墙.人们被阻止并被禁止进行SYN泛洪,因为我的网站让他们一次完成50多个HTTP请求.这是一个可怕的情况,我不得不做出优化来解决它.大家,谢谢你的帮助!

最佳答案
你有启用任何类型的防火墙吗?例如,csf具有端口泛滥设置部分.
也许由于IP的某种网络活动而临时禁止IP是他们收到“未找到服务器”错误的原因.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读