Nginx – 反向代理

我有两个docker镜像,一个用于nginx,另一个用于.Net Core应用,同时运行在一个桥接networking上。 我在nginx镜像中发布了80端口,写下了这个configuration:

server { listen 80; location / { proxy_pass http://172.17.0.3:5000; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection keep-alive; proxy_set_header Host $host; proxy_cache_bypass $http_upgrade; } } 

而且我在.Net Core Image中公开了5000端口。 每当我打电话给Nginx的IP它给502 Bad Gateway 。 可能是什么问题呢?