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
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
@savokiss
首先在
centos下尝试使用$curl http://127.0.0.1命令访问nginx。如果能够成功获取到
nginx的默认主页。那么,问题基本出在防火墙上,
centos 7的防火墙使用firewalld。所以,你需要让
firewalld放行80端口。具体命令请自行
google。但愿能解决你的问题。