虚拟机相关--nginx无法访问

2019-08-11  本文已影响0人  剑风i
1.问题定位

首先在centos下尝试使用命令访问nginx。

curl http://127.0.0.1

如果能够成功获取到nginx的默认主页。
那么,问题基本出在防火墙上,centos 7 的防火墙使用 firewalld。
所以,你需要让 firewalld 放行80端口。

2.修改配置
firewall-cmd --permanent --add-service=http
firewall-cmd --permanent --zone=trusted --add-port=80/tcp

文章参考 https://segmentfault.com/q/1010000002678462/a-1020000002678535

上一篇 下一篇

猜你喜欢

热点阅读