Used Let's Encrypt to secure Ubuntu 14.04/Nginx server (failed tutorial)

I followed the DO tutorial “How to secure Nginx with Let’s Encrypt on Ubuntu 14.04,” but when I open my site in the browser (Firefox) it does not show as secure (https://). The certbot tells me that I have a valid cert. All the .pem files are present. I am at a loss. I am running Ghost 0.11.1 on Ubuntu 14.04 Nginx.

Show comments

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Are you sure you followed whole tutorial you linked? As far as I see, there is no any directive for SSL. Also it is listening on HTTP (80) port instead of HTTPS (443). [How To Secure Nginx with Let’s Encrypt on Ubuntu 14.04] describes what you need to change in Nginx config file to use SSL.

First of all make sure you created Diffie-Hellman Group located at /etc/ssl/certs/dhparam.pem. If you did it, make sure you follow said tutorial from Step 3 — Configure TLS/SSL on Web Server (Nginx).

Your server block should look something like:

server {
    listen 443 ssl default_server;
    listen [::]:443 ssl default_server;
    server_name; # Replace with your domain

    ssl_certificate /etc/letsencrypt/live/;
    ssl_certificate_key /etc/letsencrypt/live/;

    root /usr/share/nginx/html;
    index index.html index.htm;

    client_max_body_size 10G;

    ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
    ssl_prefer_server_ciphers on;
    ssl_dhparam /etc/ssl/certs/dhparam.pem;
    ssl_session_timeout 1d;
    ssl_session_cache shared:SSL:50m;
    ssl_stapling on;
    ssl_stapling_verify on;
    add_header Strict-Transport-Security max-age=15768000;

location / {
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header Host $http_host;
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_buffering off;
# Redirect all HTTP (80) traffic to HTTPS (443)
server {
    listen 80 default_server;
    listen [::]:80 default_server;
    return 301 https://www.$server_name$request_uri;

If you created some other config file in /etc/nginx/sites-available make sure you made symbolic link from /etc/nginx/sites-available/ to /etc/nginx/sites-enabled. Also make sure old one is disabled.

Make sure you restarted or reloaded nginx sudo systemctl restart nginx. Don’t forget to change to your domain ;)

That did it! I had improperly linked the /etc/nginx/sites-available/ to /etc/nginx/sites-enabled/ Thanks for the help!!!

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

Featured on Community

Get our biweekly newsletter

Sign up for Infrastructure as a Newsletter.

Hollie's Hub for Good

Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.

Become a contributor

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

Welcome to the developer cloud

DigitalOcean makes it simple to launch in the cloud and scale up as you grow — whether you're running one virtual machine or ten thousand.

Learn more
DigitalOcean Cloud Control Panel