Question

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:

/etc/nginx/sites-enabled
server {
    listen 443 ssl default_server;
    listen [::]:443 ssl default_server;
    server_name example.com www.example.com; # Replace with your domain

    ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem;

    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_ciphers 'ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:AES:CAMELLIA:DES-CBC3-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!aECDH:!EDH-DSS-DES-CBC3-SHA:!EDH-RSA-DES-CBC3-SHA:!KRB5-DES-CBC3-SHA';
    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_pass http://allthemoore.com:2368;
    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;
    server_name example.com www.example.com;
    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/example.com 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 example.com to your domain ;)

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

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