Cloudflare Force or redirect to HTTPS in Nginx

I need to redirect anyone that enters on a specific domain/subdomain to use https protocol…

This is how

    server {
       ...
       if ($http_x_forwarded_proto = "http") {
         return 301 https://$server_name$request_uri;
       }
       ... 
    }

Grabbed from http://serverfault.com/questions/250476/how-to-force-or-redirect-to-ssl-in-nginx

Leave a Reply

Your email address will not be published. Required fields are marked *

*