centos7 nginx启动成功但是访问不了

首先检查

nignx -t

然后查看

ps -ef | grep  nginx

如果以上都没有问题那就是防火墙的问题

sudo firewall-cmd --permanent --zone=public --add-service=http 
sudo firewall-cmd --permanent --zone=public --add-service=https

sudo firewall-cmd --reload

依次运行然后重新访问

你可能感兴趣的:(centos7 nginx启动成功但是访问不了)