title: nginx docker container cannot read certbot certificates
body: <p>I've installed certbot locally and successful managed to create certificates for mydomain.blah and site1.mydomain.blah, which are in <code>/etc/letsencrypt/live/mydomain.blah</code> and <code>/etc/letsencrypt/live/site1.mydomain.blah</code></p>
  <p>Now I'm trying to use them inside an nginx container, so in my docker-compose I've mapped a volume like this:</p>
  <pre><code>version '3.4'
  
  services:
    webserver:
      image: nginx
      volumes:
        - ./conf:/etc/nginx/conf.d
        - /etc/letsencrypt/live:/cert
      ports:
        - &quot;80:80&quot;
        - &quot;443:443&quot;
  </code></pre>
  <p>and my nginx conf is just like that:</p>
  <pre><code>server {
      listen       443 ssl;
      server_name  mydomain.blah;
  
      ssl_certificate /cert/mydomain.blah/fullchain.pem;
      ssl_certificate_key /cert/mydomain.blah/privkey.pem;
  
      location / {
          proxy_pass http://1.2.3.4:8080;
      }
  }
  
  server {
      listen       443 ssl;
      server_name  site1.mydomain.blah;
  
      ssl_certificate /cert/site1.mydomain.blah/fullchain.pem;
      ssl_certificate_key /cert/site1.mydomain.blah/privkey.pem;
  
      location / {
          proxy_pass http://4.3.2.1:8080;
      }
  }
  </code></pre>
  <p>but when I spin up my docker-compose, nginx exits with the error <code>cannot load certificate &quot;/cert/mydomain.blah/fullchain.pem&quot;</code> because there is <code>No such file or directory</code>.</p>
  <p>I've tried to docker exec into the container and both the folders and their certificates are there as expected, so I can't understand what could be the problem</p>