美文网首页
Centos 7 下nginx无法访问

Centos 7 下nginx无法访问

作者: 素年锦时2021 | 来源:发表于2018-05-09 00:23 被阅读0次
590.jpg

centos7默认使用firewalld作为防火墙。我说iptables怎么没开。。

firewalld默认已经安装并启用了,如果需要nginx可以访问需要执行以下命令:
firewall-cmd --permanent --add-service=http
firewall-cmd --permanent --zone=trusted --add-port=80/tcp

或者关闭防火墙服务:

systemctl stop firewalld
开启端口
 
firewall-cmd --zone=public --add-port=80/tcp --permanent
 
命令含义:
 
--zone #作用域
 
--add-port=80/tcp  #添加端口,格式为:端口/通讯协议
 
--permanent   #永久生效,没有此参数重启后失效
 
重启防火墙
 
firewall-cmd --reload

相关文章

网友评论

      本文标题:Centos 7 下nginx无法访问

      本文链接:https://www.haomeiwen.com/subject/gimgrftx.html