0

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 based on some rules.

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?

4
  • I'm assuming these are multiple docker-compose applications, with one of the containers in each application being an nginx container that plays the role of reverse-proxy or something like that? Or are the dockerized nginx services performing the same role as the main nginx service? Commented Sep 25, 2021 at 12:32
  • @samuelj123 docker-compose applications, with one of the containers in each application being an nginx container that plays the role of a reverse-proxy. The applications are totally different with different containers. Commented Sep 25, 2021 at 12:34
  • In the abstract, fewer hops are usually better, but I don't think this setup would cause any practical problems. What happens if you try it? Commented Sep 25, 2021 at 12:40
  • @DavidMaze I didn't try it yet. I need some feedbacks before doing so. Commented Sep 25, 2021 at 12:42

1 Answer 1

1

If you want the added security of a separate Nginx container per cluster of microservices that's fine, but, it comes with the latency hit of another request or redirect between endpoints, consider that every new request has to go through the first reverse proxy and then through another one, the benefits that each one handles a different group of services are mainly security-wise but are negligible when considering it's all running on the same host and are part of the same application stack, on top of creating a debugging nightmare if an inter-service issue occurs and you need to find out where the root cause is.

The more cost-effective and simpler solution as I see it is consolidating and the proxies under a single main one that will handle the TLS termination and the routing to the different services

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.