Using LetsEncrypt for SSL cert

Oct 13, 2018 1 min read

Along with the new server and blogging platform, I finally tried out for free SSL certs.

This was totally awesome! I'm using Ubuntu 16.04 and it was pretty copy/paste.

Install via apt

apt-get install letsencrypt

Generate SSL cert

letsencrypt certonly --webroot -w /var/www/ghost -d -d

Update nginx config

server {
  listen 80 default_server;
  listen [::]:80 default_server;
  return 301$request_uri;

server {
  listen 443 ssl default_server;
  listen [::]:443 ssl default_server;

  ssl on;
  ssl_certificate /etc/letsencrypt/live/;
  ssl_certificate_key /etc/letsencrypt/live/;

  root /var/www/ghost;
  index index.html;

  location / {
    try_files $uri @ghost;

  location @ghost {
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header HOST $http_host;
    proxy_set_header X-NginX-Proxy true;

    proxy_redirect off;

Join the conversation

Great! Next, complete checkout for full access to Brandon's Blog.
Welcome back! You've successfully signed in.
You've successfully subscribed to Brandon's Blog.
Success! Your account is fully activated, you now have access to all content.
Success! Your billing info has been updated.
Your billing was not updated.