Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign up502 Bad Gateway when connecting to backend with VIRTUAL_PROTO=https #1465
Comments
Are nginx-proxy and your nginx container on the same docker network? It could be that this is not related to https at all but a generic connection issue. |
@tkw1536 I'm pretty sure they are on the same network:
Then I started nginx-proxy container with
@tkw1536 what additional steps could I take to verify they are on the same network? |
To verify your containers you could do something like:
This will print the names of all containers on the Furthermore, it might indeed be the self-signed certificate that is the problem.
to turn it off explicitly. One other thought is that the http 502 comes from the inner (https-servering) nginx. Did you ever try accessing that directly? Can you provide a complete Dockerfile for the nginx container? Then I might be able to reproduce and debug this on my machine. |
My backend container is nginx that redirects http on port 80 to https on port 443. It uses a self-signed certificate.
When I try to run and access this container without nginx-proxy at all - it works like expected.
Now I want to run it with nginx-proxy in front of it, but despite my efforts I get error 502 Bad Gateway. I must be missing something. What I've done:
Should I do something else? What could be causing the 502 Bad Gateway?
There are no errors in nginx's access/error logs (it's configured to "debug" level). So how can I debug this?
This is the nginx config file:
This is docker-compose.yml
This is the command I used to generate self-signed certificate: