skip to Main Content

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.

my domain names hover

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.

nignx proxy manager

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.

enter image description here

2

Answers


  1. The url in npm should be external host ip + port that is redirected to the container, not the ip of the network inside docker.

    Login or Signup to reply.
  2. 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:

    $ docker inspect nginx | grep -B1 IPAddress
                        "Gateway": "172.19.0.1",
                        "IPAddress": "172.19.0.2",
    

    You’re setting IPAddress as the IP for WordPress in NPM, but you should be setting it to Gateway.

    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:
    Nginx Proxy Manager, IP set to 172.19.0.1, port is set to 8080

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search