【问题标题】:I cannot ping domain under the same server but can from other machine我无法在同一台服务器下 ping 域,但可以从其他机器
【发布时间】:2018-05-25 01:30:58
【问题描述】:

我的网络服务器架构是cloudflare CDN ----> Nginx ---> Web

例如,网络域是 www.weba.com。
我可以从本地机器访问 weba

curl www.weba.com  -> get response

但是,当我 ssh 进入 weba 时,然后在终端中输入

curl www.weba.com ->  url: (7) Failed to connect to www.weba.com port 80: Connection refused
ping www.weba.com -> get response!
traceroute www.weba.com -> get response and show only one step.

如何获得更多细节或解决问题?

【问题讨论】:

    标签: ubuntu server


    【解决方案1】:

    尝试从目标主机的终端通过 ip & localhost 进行本地连接:

    curl -i http://localhost:80
    telnet localhost 80
    

    如果您没有被拒绝,这看起来像是防火墙问题。 检查 iptables 以查看是否有任何明确的规则会阻止您的本地主机访问端口 80(我假设那是您的网络服务器):

    iptables -L
    

    如果你被拒绝了,似乎 nginx 是罪魁祸首。检查您的 nginx 配置和错误日志以了解与您的错误相关的任何内容。我不认为 nginx 是原因,因为“连接被拒绝”似乎是在它到达您的网络服务器之前发生的,它是规则。

    【讨论】:

    • curl -i http://localhost:80 没问题。 iptables -L 不显示任何规则。和cloudflare有关吗?
    • 我还检查了 nginx 错误日志。它没有显示任何相关内容
    猜你喜欢
    • 2018-06-14
    • 1970-01-01
    • 2020-12-29
    • 1970-01-01
    • 2016-11-21
    • 2014-12-13
    • 1970-01-01
    • 2015-07-23
    • 1970-01-01
    相关资源
    最近更新 更多