1:先查看nginx是否启动
[root@***********]# ps -ef | grep nginx
root 17619 1 0 00:52 ? 00:00:00 nginx: master process /usr/sbin/nginx
nginx 17620 17619 0 00:52 ? 00:00:00 nginx: worker process
nginx 17621 17619 0 00:52 ? 00:00:00 nginx: worker process
nginx 17622 17619 0 00:52 ? 00:00:00 nginx: worker process
nginx 17623 17619 0 00:52 ? 00:00:00 nginx: worker process
root 17785 17728 0 01:23 pts/1 00:00:00 grep --color=auto nginx
2: 查看配置是否成功
[root@************ ~]# /usr/sbin/nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
3:添加防火墙开放端口
[root@********t ~]# firewall-cmd --zone=public --add-port=你的端口号/tcp --permanent
添加成功显示success
4:重启防火墙服务
[root@********* ~]# systemctl restart firewalld.service
搞定收工! 点个赞 分享更多liunx问题