Docker部署Nginx报错 WARNING: IPv4 forwarding is disabled. Networking will not work.
Posted on 2022-11-05 15:17 Qtoken 阅读(165) 评论(0) 编辑 收藏 举报Docker 部署 Nginx 报错 WARNING: IPv4 forwarding is disabled. Networking will not work.
[root@localhost ~]# docker run --name nginx-1 -p 8080:80 -d nginx
一、解决方法
1.修改配置文件
echo "net.ipv4.ip_forward=1" >>/usr/lib/sysctl.d/00-system.conf
2.重启网络和docker服务
systemctl restart network && systemctl restart docker
3.打开浏览器,输入 服务器IP:8080,查看访问结果