October 12, 2017 · Server

Nginx http to https config

nginx config

listen 443 ssl;
ssl_certificate_key /path/to/cert.key;
ssl_certificate /path/to/encrypted.crt;
if ($scheme = http) {
    return 301 https://$server_name$request_uri;
}