before posting my problem, I would like to know if it is even possible to achieve what I want.
I have, say, myserver.com running a docker container with nginx and letencrypt. On the same server, there are 2 more docker containers running websites.
So far, everything has been redirected perfectly, so www.myserver.com goes to docker 1, and site2.myserver.com goes to docker 2.
I would like all communication to work over HTTPS, but here the problem begins. So my question is: is it possible to docker with nginx and letencrypt to connect to another docker using certificates from letencrypt? It seems to me that this is some kind of “attack” of a person in the middle. A bit more schematic:
Go to http://site2.myserver.com → nginx redirects to https://site2.myserver.com → connect to container 2 (192.168.0.10) on port 80. Or another option: Go to http: // site2.myserver.com -> nginx redirects to https://site2.myserver.com -> connect to container 2 (192.168.0.10) on port 443, which has site2.myserver.com certificates.
If this is not possible, then what is the solution? Copying certificates to docker containers and starting https so that the HTTP request is redirected to the https port of this container?
Go to http://site2.myserver.com → nginx forward the request → connect to container 2 (192.168.0.10) on port 443, which has site2.myserver.com certificates.
Thanks Greggy