虚拟机里nginx可以访问,但外部不能访问,解决方法:
vim /etc/sysconfig/iptables
添加 -A RH-Firewall-1-INPUT -m state –state NEW -m tcp -p tcp –dport 80 -j ACCEPT
然后执行(即时生效,重启失效):
service iptables stop
service iptables start
重启后生效
chkconfig iptabels on
chkconfig iptabels off