independent full stack developer

/ Developer's blog

How to add SSL certificate to nginx for FREE

Thursday, June 20, 2024

Firstly we have to issue certificates, I use this service to get it done. 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.

1. Download the archive with certifcates

2. Extract it

3. 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.

4. Upload certificates to server, eg. to folder /etc/nginx/ssl

5. Add the next to your host file


server {
    listen 80;
    return 301$request_uri;

server {

        listen 443;

        ssl on;
        ssl_certificate /etc/nginx/ssl/bundle.crt;
        ssl_certificate_key /etc/nginx/ssl/private.key;




1912 people already saw it