title: nginx: [emerg] cannot load certificate "/etc/letsencrypt/live/api.domain.com/fullchain.pem"
body: <p>I have generated fullchain.pem, privkey, ssl-dhparams locally and then saved to the nginx folder which I am copying from to docker nginx container. With the below setup, I am getting issue of <code>nginx: [emerg] cannot load certificate &quot;/etc/letsencrypt/live/api.domain.com/fullchain.pem&quot; failed (SSL: error:02001002:system library:fopen:No such file or directory:fopen('/etc/letsencrypt/live/api.domain.com/fullchain.pem','r') error:2006D080:BIO routines:BIO_new_file:no such file</code></p>
  <p>nginx.dockerfile</p>
  <pre><code>FROM nginx
  
  COPY nginx.conf /etc/nginx/nginx.conf
  COPY fullchain.pem /etc/letsencrypt/live/api.domain.com/fullchain.pem
  COPY privkey.pem /etc/letsencrypt/live/api.domain.com/privkey.pem
  COPY options-ssl-nginx.conf /etc/letsencrypt/options-ssl-nginx.conf
  COPY ssl-dhparams.pem /etc/letsencrypt/ssl-dhparams.pem
  </code></pre>
  <p>nginx.conf</p>
  <pre><code>http {
    include mime.types;
    default_type application/octet-stream;
    access_log /var/log/nginx/access.log combined;
    sendfile on;
    upstream app_server {
        server backend:8080 fail_timeout=0;
        # server APP_SERVER_2_IP;
    }
  
    server {
        listen 80 default_server;
        return 444;
    }
  
    server {
        listen 80;
        listen [::]:80;
        server_name api.domain.com;
        return 301 https://$server_name$request_uri;
    }
  
    server {
        server_name api.domain.com;
  
        client_max_body_size 4G;
        keepalive_timeout 5;
        location / {
          proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
          proxy_set_header X-Forwarded-Proto $scheme;
          proxy_set_header Host $http_host;
          proxy_redirect off;
          proxy_pass http://app_server;
        }
        listen 443 ssl http2;
        listen [::]:443 ssl http2;
        # SSL
        ssl_certificate /etc/letsencrypt/live/api.domain.com/fullchain.pem;
        ssl_certificate_key /etc/letsencrypt/live/api.domain.com/privkey.pem;
        include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
        ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
  
    }
  }
  </code></pre>
  <p>why am I getting such issue?</p>
  <p>UPDATE:</p>
  <p>Sorry, I mismatched the name while copying my code. I have updated with it now.</p>