【问题标题】:debian port 80 does not accept remote connectionsdebian 80 端口不接受远程连接
【发布时间】:2015-11-07 00:21:55
【问题描述】:

我有一个 Node.js 快递网站,它正在侦听端口 9000,在我将端口更改为 80 之前一切正常,现在它只接受来自本地的连接:

wget http://127.0.0.1/ -O -
curl 127.0.0.1:80

本地工作正常,他们返回 html 页面。但它不接受来自浏览器的远程连接,无论是使用外部 IP 地址还是域名。

# iptables

Chain INPUT (policy ACCEPT)
target     prot opt source               destination         
ACCEPT     tcp  --  0.0.0.0/0            0.0.0.0/0            tcp dpt:80
ACCEPT     tcp  --  0.0.0.0/0            0.0.0.0/0            tcp dpt:80
ACCEPT     tcp  --  0.0.0.0/0            0.0.0.0/0            state NEW tcp dpt:80
ACCEPT     tcp  --  0.0.0.0/0            0.0.0.0/0            tcp dpt:80

【问题讨论】:

  • 你能发布netstat -anpt的输出吗?
  • 请向我们展示您的Node.js 实例的(相关)配置,您可以在其中配置端口:配置只接受特定接口上的连接的服务器很容易(例如lo
  • 谢谢你们有兴趣帮助我,我已经弄清楚了,端口转发规则是将连接从端口 80 重定向到另一个端口

标签: node.js http debian remote-access iptables


【解决方案1】:

好吧,我已经找到了问题,这是我的 iptables 规则将远程连接从外部转发到另一个端口。

【讨论】:

    猜你喜欢
    • 2017-10-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-04-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多