Score:0

Use multiple dockerized Nginx behind a host Nginx

in flag

I have multiple and different dockerized applications, each one comes with its proper Nginx service which sends traffic to its containers based on some rules.

I need to put those applications on the same server, so I added a new Nginx in the host that will handle SSL, and forward the traffic to the correct dockerized Nginx.

Question: Is it ok to use Nginx in the host which will forward traffic to multiple different dockerized Nginx? Does it have any known problems? will that affect performance?

Michael Hampton avatar
cz flag
Most people use something like jwilder/nginx-proxy for this situation.
Score:1
us flag
  1. Is it ok to use Nginx in the host which will forward traffic to multiple different dockerized Nginx?

    Yes. This is one way to do it.

  2. Does it have any known problems?

    The host instance of NGINX is not containerised which may make it more difficult to configure. Another common way to do this is to have a docker container bound to port 80 and 443 which handles all ingress traffic and diverts it to the corresponding container.

    Finally, other container orchestration systems like Kubernetes have the concept of Ingress built in and allow it to be configured just like you'd configure a container in Docker compose. The upside to Kubernetes Ingress is that it can scale up/down to multiple servers whereas you are more limited with Docker compose.

  3. Will that affect performance?

    Having an extra hop to get to the destination container does negatively harm performance but its a common thing to do.

Score:1
za flag
  1. Is it ok to use Nginx in the host which will forward traffic to multiple different dockerized Nginx?

    Yup, it's actually a common practice.

  2. Does it have any known problems?

    Caused by this setup itself - nope.

  3. Will that affect performance?

    In a way - sure: like every other load balancer (which it is) it will add some delay on buffering and TCP sockets.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.