0

So I'm having trouble getting my ssl cert working properly in a rails app with nginx. Do I need to use the sites-available folder, or can I just stick all my cert info in the /opt/nginx/conf/nginx.conf file? Currently, my nginx.conf file looks like this, but when I try to access the site using https it doesn't work. Before this, I have another server block that listens on port 80, and that works for http, but this one for https doesn't work. Any ideas?

server {
    listen       443;
    server_name  www.mysite.com;
#localhost;

    ssl on;
    ssl_certificate reference to my pem file
    ssl_certificate_key reference to my key file
    root reference to app in /var/www

#    ssl                  on;
#    ssl_certificate      cert.pem;
#    ssl_certificate_key  cert.key;

#    ssl_session_timeout  5m;

#    ssl_protocols  SSLv2 SSLv3 TLSv1;
#    ssl_ciphers  HIGH:!aNULL:!MD5;
#    ssl_prefer_server_ciphers   on;

#    location / {
#        root   html;
#        index  index.html index.htm;
#    }
}

1 Answer 1

1

I spent a lot of time today setting up SSL on nginx. First thing I would suggest checking is that port 443 is open from something like www.checkmyports.net

Also, do you get an error when you restart nginx?

Sign up to request clarification or add additional context in comments.

2 Comments

I had figured this out, and yes, it was port 443. Accepting answer :).
Dude I just wasted 3 hours trying to reconfigure my nginx to get ssl requests working and 443 was closed the whole time. If I could give you ten upvotes I'd do it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.