起因: 在远端服务器访问47服务器上的80端口,不通!!!
解决历程如下:
1.排查47服务器上的nginx服务是否正常运行
[root@localhost fs-traffic]# ps -ef|grep nginx nobody 23492 26428 0 oct12 ? 00:02:12 nginx: worker process root 26428 1 0 sep29 ? 00:00:00 nginx: master process /usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf root 31683 5934 0 16:11 pts/6 00:00:00 grep --color=auto nginx
2.检查80端口是否正常启动, 可以看到正在运行的端口中有80端口
[root@localhost fs-traffic]# netstat -aptn active internet connections (servers and established) proto recv-q send-q local address foreign address state pid/program name tcp 0 0 0.0.0.0:6000 0.0.0.0:* listen 23492/nginx: worker tcp 0 0 0.0.0.0:80 0.0.0.0:* listen 23492/nginx: worker tcp 0 0 0.0.0.0:6001 0.0.0.0:* listen 23492/nginx: worker
3.查看端口是否被防火墙阻挡。 发现防火墙并未开启。
[root@localhost fs-traffic]# systemctl status firewalld ● firewalld.service - firewalld - dynamic firewall daemon loaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled; vendor preset: enabled) active: inactive (dead) docs: man:firewalld(1)
4.排查是否开通远端服务器到47服务器上80端口的策略, 咨询网络管理员说是已开通该策略,网络没问题,可能是47服务器本机的问题。但是对网络管理员包有怀疑态度,所以进行下一步排查。
5.检查47同网段其他服务器到47服务器的80端口是否开通, 如下是在47同网段的44服务器telnet47的80端口返回的结果。发现不通,说明不是网络问题,确实是47本机的问题
[root@localhost fs-traffic]# telnet 192.162.20.47 80 给出的提示: no route to host
6.然后,然后,我快疯了!!! 究竟是什么情况?!!
7.根据以上的提示“no route to host” 查了下资料,有网友发的贴子的意思这个错误可能是由于47服务器防火墙存在规则限制,可以尝试执行以下操作清空防火墙规则。 冒着试试的态度执行了该命令,后来发现启发服务器访问47服务器的80端口通了! woc !!! 终于通了。
[root@localhost fs-traffic]# sudo iptables -f
疑问:
47服务器本身防火墙就没开启,按理说即便配置防火墙规则也是无法生效的。但是为什么在这种情况下清空防火墙规则就可被其他服务器访问通了呢?离谱,百思不得其解,忘大佬指教!!!
到此这篇关于nginx的80端口无法被远程服务器访问的问题解决的文章就介绍到这了,更多相关nginx 80端口无法访问内容请搜索代码网以前的文章或继续浏览下面的相关文章希望大家以后多多支持代码网!
发表评论