Following link provides required steps for setting up SSL on nginx:
nginx setup
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.