A
A
alameya2016-08-30 15:17:04
Nginx
alameya, 2016-08-30 15:17:04

How to properly organize multiple nginx virtual hosts in Docker?

From docker's point of view, each process is a separate container.
1. Does this mean that each individual site should run in a separate container?
2. If item 1 is yes, then how to scatter between these containers the users of the control machine that are hollowed out on 80/443 ports?
3. If there is no item 1, then how to properly separate the automated integration of applications?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
P
Pavel, 2016-08-30
@pvlg

Each application can be run in a separate application, or in one, a matter of taste. The problem is that all applications want 80/443 port.
To solve this problem, you can start one container with nginx and configure it as a reverse proxy, i.e. it will take ports and scatter requests across containers based on the host address.
I can recommend a ready-made image for this https://github.com/jwilder/nginx-proxy

D
Dmitry, 2016-08-30
@dmtrrr

Nothing prevents you from having one container with nginx and one container per site.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question