Configure SSL with LetsEncrypt and nginx

Reading Time : ~ .

Configuring SSL is beneficial not only for security purpose but also for SEO too.

Linux software foundation's initiated a program called Let’s Encrypt to give SSL certificates for free and it is in preview state as of today. You can whitelist your domain by registering  here. You can configure after getting confirmation from Let’s Encrypt team.

Here are the steps to generate Let’s Encrypt SSL and configure with NGINX.

  $ git clone https://github.com/letsencrypt/letsencrypt

  $ cd letsencrypt

  $ ./letsencrypt-auto --agree-dev-preview --server \
    https://acme-v01.api.letsencrypt.org/directory auth

Note: Select Standalone option.

Note: Enter your Email address when asked.

By default, the certificates will be created at /etc/letsencrypt/live/

Now you need to configure Nginx by adding your pem files as showed below.

  server {

      listen 443 ssl;

      server_name micropyramid.com;

      ssl_certificate /etc/letsencrypt/live/micropyramid.com/fullchain.pem;

      ssl_certificate_key /etc/letsencrypt/live/micropyramid.com/privkey.pem;

  }

You need to change the domain name to the one you want to configure.

Then, reload the Nginx using -

  $ sudo service nginx reload

We are happy to help, ask if you have any difficulties by writing to us at hello@micropyramid.com

    By Posted On
SENIOR DEVELOPER at MICROPYRAMID

Need any Help in your Project?Let's Talk

Latest Comments
Related Articles
How to backup and restore your database(mysql, postgresql, mongodb) Nikhila Mergu

Data loss can happen when we accidentally delete the files, or when server crashes or system fails, or when we applied migrations to the data ...

Continue Reading...
Daemonizing any command with SUPERVISOR Ashwin Kumar

Daemonizing a command means to make it run as a background process.

so when we have a command that we want to daemonize there are ...

Continue Reading...
php7 hosting on Ubuntu Server with Nginx(LEMP stack) Ashwin Kumar

PHP7 is the latest version with lot of performance improvements and every one want to update their servers and code to it. Lets see how ...

Continue Reading...

Subscribe To our news letter

Subscribe to our news letter to receive latest blog posts into your inbox. Please fill your email address in the below form.
*We don't provide your email contact details to any third parties