Home > Operation and Maintenance > Docker > The docker container cannot access the external network through HTTP

The docker container cannot access the external network through HTTP

王林
Release: 2020-03-23 18:06:00
Original
5455 people have browsed it

The docker container cannot access the external network through HTTP

The phenomenon is as follows:

1. The internal/external network IP and domain name can be pinged

2. The container cannot access the internal network where the host is located And external web services (404)

3. Check the return header information through curl. It seems that all web requests are forwarded to a fixed Nginx server

4. All containers (including newly created ) the above problems occur

The solution is as follows:

The problem can be solved by rebuilding the docker0 network.

The command is as follows:

$ sudo service docker stop
$ sudo pkill docker
$ sudo iptables -t nat -F
$ sudo ifconfig docker0 down
$ sudo brctl delbr docker0
$ sudo service docker start
Copy after login

Recommended related tutorials: docker tutorial

The above is the detailed content of The docker container cannot access the external network through HTTP. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template