nginx已经启动 无法访问页面

 通过IP访问,可以看到  welcome nginx 的提示

下面我重启linux服务器,重启后通过ip访问,死活连接不上了?没办法了,只有在百度和google

    最后发现问题不是出在nginx上,而是出在iptable上,在iptable上添加80端口

#vi /etc/sysconfig/iptables  
//在倒数第二行加入80端口  
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT  
  
  
//重启iptables  
#/etc/init.d/iptables restart  

  

 再通过ip访问  ok~  没问题了

原文地址:https://www.cnblogs.com/songanwei/p/9239821.html