I have a website running where I use Nginx Proxy Manager to redirect to this website. However, as soon as I hit my website I get the following message:
Does anyone have a clue what is happening here?
Finally, I came to the following conclusion. I think from my experience it can mean two things:
However, hostinger.com points out the following:
So make sure that index.html is present for your website and you have trouble shooted your container where you are 100% sure that docker container has no exceptions, errors and runs perfectly fine. Try use something like 'docker-compose logs' where the docker-compose.yml is located (this only works for a running docker container)
Had the same error!
I've put posted my solution under the question nginx docker container: 502 bad gateway response, because it goes for Nginx run via Docker as well and is more easily found there.
My solution is about when your destination services/apps are also containerized.
But at the bottom I show how to solve this, when your destinations are not containers.
Nginx (Proxy Manager) - run as Docker container - has its own network!
You can't forward to localhost, because that's the NPM container itself!
You also can't reach the host machine, because that's outside of its network.
Here's a good explanation with visualization.
put the Nginx Proxy Manager on the host network (by defining network_mode: host in its docker-compose.yml -> that's awkward, because now you can't control the port forwarding to that anymore (you can straight up delete the ports section)
[RECOMMENDED] put the NPM and all your services/apps/websites (which must all be containerized too, for this to work!) on one shared network!
-> I show how to implement this here in my other post
localhostinstead of the docker compose service name, in the "Forward Hostname / IP" field.