Set up SSL on my nginx Linode?

I'm trying to set up SSL on my Linode, which has nginx.

I'm following this guide from Namecheap.

I'm stuck on step 3. What part of my /etc/nginx/nginx.conf file do I edit? What do I put there?

5 Replies

When setting up an SSL certificate in Nginx you'll want to create a new server block that listens on port 443. We have a guide on general Nginx configuration that may help, specifically the section on configuring server blocks.

Thanks, that helped a bit. I edited my file at /etc/nginx/sites-enabled/my_site so that the top section of the server {} block is this.

server {
    listen 443;
    ssl on;
    ssl_certificate /etc/ssl/cert_chain.crt;
    ssl_certificate_key /etc/ssl/richblockspoorblocks.key;
    server_name test.richblockspoorblocks.com;
    error_log /var/log/nginx/debug.log debug;

    ... Rest of code ...
}

I ran nginx restart. But if I go to https://test.richblockspoorblocks.com in Chromium, my browser warns that my connection to the site is insecure.

Have you used the SSL Server test from Qualys?

According to their test, the certificate you are using is only good for richblockspoorblocks.com and www.richblockspoorblocks.com, but not test.richblockspoorblocks.com.

You'll need to recreate the certificate to include the subdomains or create a new certificate for your subdomains.

Turns out I needed a wilcard SSL. I bought one, now it works.

Setting up an wildcard SSL can be easy. There's another Community post that covers how to get your wildcard SSL set up:

What are my options for creating a wildcard SSL certificate?

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct