I need help pls!
I’m trying to setup Nginx Proxy Manager with my docker container. I’ve been following this tutorial from YouTube! Putting it All Together – Docker, Docker-Compose, NGinx Proxy Manager, and Domain Routing – How To
I created two subdomains in Hover.com exactly how the tutorial is doing.
With minor changes… he uses "docks" and "manage-docks" I just replaced "docks" with "docker".
I have a server on Vultr where I installed my docker containers. In the tutorial, he used DigitalOcean droplet. Anyway, I’m using my Vultr’s machine IP address to point to those two subdomains.
Navigating to docker.mydomain.com:81 does take me to the login page for Nginx Proxy Manager. But when I try to setup manage-docker.mydomain.com as a proxy host, the webpage doesn’t even load for some reason.
Here are my docker containers hosted on Portainer. As you can see, I’m trying to load up WordPress as my test dummy to see when things work. I only can see WordPress when I navigate to port :8080.
But the point of Nginx Proxy Manager is to get rid of the port, but so far not luck. Perhaps I’m missing something here? I hope you guys can help me out! Thanks!
I’m open to other software other than Nginx Proxy Manager if it makes it easier.
2
Answers
The url in npm should be external host ip + port that is redirected to the container, not the ip of the network inside docker.
Your container and NPM are on different docker networks, so you can’t reference the container’s IP. Instead, reference the gateway.
As an example, let’s say I created an nginx container with
docker run 8080:80 -v ./html:/html -d nginx
. Then let’s say I run this to find my IP address:You’re setting
IPAddress
as the IP for WordPress in NPM, but you should be setting it toGateway
.Note that you still need to set it to the host’s port, not the port of WordPress inside the container. In my example, I would use these settings in NPM: