nginx启动成功,页面还是无法访问?

发布时间 2023-03-31 14:32:47作者: 借你耳朵说爱你

问题如下图:

 1.检查Nginx配置文件:nginx -t

2.每次修改配置文件都要重新加载、启动
nginx -s reload # 重新载入配置文件
nginx -s reopen # 重启 Nginx

3.查看nginx进程

 4.查看防火墙状态(不同Linux版本防火墙不同,以CentOS Linux release 7.9为例)

查看状态:systemctl status firewalld

关闭状态如下图:

 开启状态如下图:

 停止并禁用开机启动:systemctl disable firewalld

 禁用防火墙:systemctl stop firewalld

 启动防火墙:systemctl start firewalld

设置开机启动:systemctl enable firewalld

重启防火墙:systemctl restart firewalld