nader's thinkery

Nginx Redirect HTTP to HTTPS

Nginx Redirect HTTP to HTTPS

tutorial nginx howto May 15, 2013
Redirecting HTTP-Traffic to HTTPS is easy with this simple configuration:

server {         listen          80;

        server_name     example.com;

        rewrite         ^ https://$server_name$request_uri? permanent;

}

server {

        listen       443;

        server_name example.com;         ...