If I stop the iptables service, things will work. I need to know how to change the iptables configuration to allow container access to host ports.

I have an nginx container on this RHEL 7 server accepting connections to port 443. On the same server, the jupyterhub is running on port 8000 without ssl. proxy_pass is used to open the jupyterhub from web browsers.

curl https://HOSTNAME
<head><title>502 Bad Gateway</title></head>

docker logs nginx-container
CLIENT-IP - - [08/Apr/2019:17:05:47 -0500] "GET / HTTP/1.1" 502 150 "-" "curl/7.29.0" "-"
2019/04/08 17:05:47 [error] 6#6: *11 connect() failed (113: No route to host) while connecting to upstream, client: CLIENT-IP, server: HOSTNAME, request: "GET / HTTP/1.1", upstream: "http://HOST-IP:8000/", host: "HOSTNAME"

If I use non-docker nginx proxy, there is no problem at all.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.