我的服务器 IP 是132.145.167.69
。我已设置Nginx
并允许入站/出站流量,但仍然无法在浏览器中打开 IP 或获取任何内容Nginx
access.log
。
在服务器上:
curl -I http://localhost:80
HTTP/1.1 200 OK
Server: nginx/1.14.0 (Ubuntu)
Date: Fri, 27 Sep 2019 14:04:05 GMT
Content-Type: text/html
Content-Length: 612
Last-Modified: Fri, 20 Sep 2019 05:18:46 GMT
Connection: keep-alive
ETag: "5d846136-264"
Accept-Ranges: bytes
在我的系统上:
curl -I http://132.145.167.69:80
HTTP/1.1 503 Service Unavailable
Server: squid/3.5.27
Mime-Version: 1.0
Date: Fri, 27 Sep 2019 14:04:37 GMT
Content-Type: text/html;charset=utf-8
Content-Length: 3484
X-Squid-Error: ERR_CONNECT_FAIL 60
Vary: Accept-Language
Content-Language: en
X-Cache: MISS from localhost
X-Cache-Lookup: MISS from localhost:3128
Via: 1.1 localhost (squid/3.5.27)
Connection: keep-alive
有人能给我指明正确的方向吗?
答案1
问题在于iptables
,我必须手动添加端口 80 和 443 的条目。
sudo iptables -I INPUT 2 -p tcp --dport 443 -j ACCEPT
sudo iptables -I INPUT 2 -p tcp --dport 80 -j ACCEPT
sudo iptables-save > /etc/iptables/rules.v4