首页 > 系统相关 >Docker部署Nginx报错 WARNING: IPv4 forwarding is disabled. Networking will not work.

Docker部署Nginx报错 WARNING: IPv4 forwarding is disabled. Networking will not work.

时间:2022-11-05 15:22:37浏览次数:57  
标签:disabled Networking will Nginx WARNING 报错 forwarding

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,查看访问结果

               

 

标签:disabled,Networking,will,Nginx,WARNING,报错,forwarding
From: https://www.cnblogs.com/Qtoken/p/16491184.html

相关文章