SSL with NGINX with .pem files
I need to add SSL certificate for my domain for my website on my NGINX server.
My domain provider gave me a zip file to download, which contains:
domain.cert.pem
intermediate.cert.pem
private.key.pem
public.key.pem
[For clarity: I did not rename 'domain', it is called domain.cert.pem
]
I'm confused as to what to do, because all the tutorials I can find online require different files, some ending with .crt.
Does anyone have any advice?
My nginx conf:
server {
listen 80 default_server;
ssl on;
server_name mydomain.com;
ssl_certificate /usr/src/app/domain.cert.pem;
ssl_certificate_key /usr/src/app/private.key.pem;
# vue app & front-end files
location / {
root /usr/src/app/dist;
try_files $uri /index.html;
}
# node api reverse proxy
location /api/ {
proxy_pass http://localhost:4000/;
}
}
Error when restarting nginx:
nginx: [emerg] PEM_read_bio_X509("/usr/src/app/domain.ce
Solution 1:
cat intermediate.cert.pem >> domain.cert.pem
In your nginx conf:
server {
...
ssl_certificate /path/to/domain.cert.pem;
ssl_certificate_key /path/to/private.key.pem;
...
}