Skip to content

Instantly share code, notes, and snippets.

@ankkho
Last active October 26, 2018 10:19
Show Gist options
  • Save ankkho/434a87dc5e165d6759548245cb225551 to your computer and use it in GitHub Desktop.
Save ankkho/434a87dc5e165d6759548245cb225551 to your computer and use it in GitHub Desktop.
Setup SSL on nginx

Following link provides required steps for setting up SSL on nginx:
nginx setup

Use the below snippet for redirecting all request from http to https:
server {
listen 80 default_server;
listen [::]:80 default_server;
return 301 https://$host$request_uri;
}

Test your ssl certificates by running the following command (without https):

openssl s_client -connect your_domain_name:443

You should get Verify return code: 0 (ok) at the end of verification.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment