title: nginx redirect to docker container
body: <p>before posting my issue, I would like to know if it is even possible to achieve what I want.</p>
  
  <p>I have, lets say, myserver.com running a docker container with nginx &amp; letsencrypt. On the same server are 2 more docker containers running websites.</p>
  
  <p>For now all is redirected fine, so www.myserver.com goes to docker 1 and site2.myserver.com goes to docker 2.</p>
  
  <p>I would like to have all communication running over HTTPS, but here starts the trouble.
  So, my question is: is it possible for the docker with nginx and letsencrypt to connect to another docker using the certificates from letsencrypt?
  To me it seems to be some kind of man-in-the-middle "attack".
  A bit more schematic:</p>
  
  <p>Browse 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:
  Browse to http:// site2.myserver.com -> nginx redirects to https:// site2.myserver.com -> connect to container 2 (192.168.0.10) on port 443 having the site2.myserver.com certificates.</p>
  
  <p>If it can't be done, what is the solution then? Copying the certificates to the docker containers and make them run https, so that a http request gets redirected to the https port of that container?</p>
  
  <p>Browse to http:// site2.myserver.com -> nginx forwards request -> connect to container 2 (192.168.0.10) on port 443 having the site2.myserver.com certificates.</p>
  
  <p>Thanks,
  Greggy</p>