时间:2021-07-01 10:21:17 帮助过:26人阅读
virtual box下安装了一个最小化的centos 7
yum安装的nginx
192.168.31.146
centos桥接ip192.168.31.158
192.168.31.158 cent.com
nginx已经启动,显示runningnginx配置文件default.conf如下:nginx -t显示正常/usr/share/nginx/html下默认有个html文件ping cent.com可以ping通,ip是158http://cent.com无法访问firewalld,我说iptables怎么没开。。firewall-cmd --permanent --add-service=httpfirewall-cmd --permanent --zone=trusted --add-port=80/tcp
virtual box下安装了一个最小化的centos 7
yum安装的nginx
192.168.31.146
centos桥接ip192.168.31.158
192.168.31.158 cent.com
nginx已经启动,显示runningnginx配置文件default.conf如下:nginx -t显示正常/usr/share/nginx/html下默认有个html文件ping cent.com可以ping通,ip是158http://cent.com无法访问firewalld,我说iptables怎么没开。。firewall-cmd --permanent --add-service=httpfirewall-cmd --permanent --zone=trusted --add-port=80/tcp
@savokiss
首先在centos下尝试使用$curl http://127.0.0.1命令访问nginx。
如果能够成功获取到nginx的默认主页。
那么,问题基本出在防火墙上,centos 7的防火墙使用firewalld。
所以,你需要让firewalld放行80端口。
具体命令请自行google。
但愿能解决你的问题。