How to add SSL certificate to nginx for FREE
Aug 2025 1 min read Aleksey Dorogov
Firstly we have to issue certificates, I use this service to get it done. https://www.sslforfree.com you just enter a domain name for which you need a certificate and then download the archive with certificates. The next step is compiling contents to one bundle.crt and tweak a host for nginx.
- Download the archive with certifcates
- Extract it
- Compile files certificate.crt and ca_bundle.crt to one file, you can use cat command or just open them with text editor and copy/paste under each other with new line.
- Upload certificates to server, eg. to folder
/etc/nginx/ssl - Add the next to your host file
server {
listen 80;
server_name example.com;
return 301 https://example.com$request_uri;
}
server {
listen 443;
server_name example.com;
ssl on;
ssl_certificate /etc/nginx/ssl/bundle.crt;
ssl_certificate_key /etc/nginx/ssl/private.key;
...
} Sitting on a version of this problem right now? I'd rather look at it than guess.
Email me