我在 centos 7 上配置了一个 Nginx 服务器,它可以从服务器上的浏览器正常运行。但是当我从任何远程客户端尝试时,它说无法连接。我尝试将 http 添加到防火墙服务中。
sudo firewall-cmd --add-port=80/tcp --permanent
结果是:
target: default
icmp-block-inversion: no
interfaces: ens192
sources:
services: dhcpv6-client ssh http https
ports: 80/tcp 443/tcp 8000/tcp
protocols:
masquerade: no
forward-ports:
source-ports:
icmp-blocks:
rich rules:
但是当我从另一个节点尝试时:
sudo nmap -sT {ip address}
我有:
PORT STATE SERVICE
22/tcp open ssh
443/tcp closed https
如果有帮助的话,结果
sudo netstat -tulpn
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 17859/nginx: master
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1263/sshd
tcp 0 0 127.0.0.1:5432 0.0.0.0:* LISTEN 12372/postgres
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 1766/master
tcp6 0 0 :::80 :::* LISTEN 17859/nginx: master
tcp6 0 0 :::22 :::* LISTEN 1263/sshd
tcp6 0 0 ::1:5432 :::* LISTEN 12372/postgres
tcp6 0 0 ::1:25 :::* LISTEN 1766/master
udp 0 0 127.0.0.1:323 0.0.0.0:* 867/chronyd
udp6 0 0 ::1:323 :::* 867/chronyd
还
sudo ufw status verbose
Status: inactive
和
sestatus
SELinux status: disabled
并且
sudo iptables -L -vn
Chain INPUT (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
674 64842 ACCEPT all -- * * 0.0.0.0/0 0.0.0.0/0 ctstate RELATED,ESTABLISHED
0 0 ACCEPT all -- lo * 0.0.0.0/0 0.0.0.0/0
123K 21M INPUT_direct all -- * * 0.0.0.0/0 0.0.0.0/0
123K 21M INPUT_ZONES_SOURCE all -- * * 0.0.0.0/0 0.0.0.0/0
123K 21M INPUT_ZONES all -- * * 0.0.0.0/0 0.0.0.0/0
0 0 DROP all -- * * 0.0.0.0/0 0.0.0.0/0 ctstate INVALID
123K 21M REJECT all -- * * 0.0.0.0/0 0.0.0.0/0 reject-with icmp-host-prohibited
0 0 ACCEPT tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp dpt:443
有人能帮我吗?