Centos上Nginx环境成功配置完毕后发现外网无法访问

1
2
3
[root@www server]# nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful

但是从浏览器端访问80端口并没有显示任何信息,直接是访问404

可能的问题之一:firewalld处于关闭状态

由于系统重启或者其他原因无意中关闭了firewalld,我们可以这样查看防火墙状态。

1
2
[root@www server]# firewall-cmd --state
not running

我们输入systemctl start firewalld开启即可。
注意防火墙端口要放开,因为我以前以及配置好了。