M
M
maksam072021-02-13 19:32:46
Django
maksam07, 2021-02-13 19:32:46

How to use nginx in conjunction with multiple containers?

Good evening! There is a project, for example:
https://github.com/testdrivenio/django-on-docker (Django, Postgres, Gunicorn, Nginx )
Following the readme for the seller, the site can be accessed at: localhost:1337
There are no special settings it is not necessary to carry out, almost immediately the site can be launched on port 1337.

I also have a separate nginx docker container that listens on ports 80 and 443.
How can I configure it so that on a specific domain (for example, example.com), it redirects the request to nginx in another container?

That is, is communication between two nginx containers real? One passes the request to the other, and the second processes it as needed. Or what is the best practice?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Dmitriev, 2021-02-13
@maksam07

Nginx reverse proxy on the host that proxies requests to containers.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question