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

The docker container cannot access the external network through HTTP

王林
王林Original
2020-03-23 18:06:005434browse

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

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!

Statement:
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