简体   繁体   English

无法从主机连接到 docker nginx 容器

[英]unable to connect to docker nginx container from host

centos 7.8 centos 7.8

docker run -d -p 8080:80 --name nginxtest nginx docker 运行-d -p 8080:80 --name nginxtest nginx

docker ps docker 秒
CONTAINER ID IMAGE PORTS NAMES容器 ID 映像端口名称
xxxxxxxxxxxxxx nginx 0.0.0.0:8080->80/tcp nginxtest xxxxxxxxxxxxxx nginx 0.0.0.0:8080->80/tcp nginxtest

curl localhost:8080 curl 本地主机:8080
curl: (56) Recv failure: Connection reset by peer curl:(56) Recv 失败:连接由对等方重置

netstat -tulpn netstat -tulpn
tcp6 0 0:::8080:::* LISTEN 13467/docker-proxy tcp6 0 0:::8080:::* 监听 13467/docker-proxy

Is there any other way to check what went wrong?有没有其他方法可以检查出了什么问题?

restart server, and problem solved.重启服务器,问题解决。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM