• Nginx Redirect HTTP to HTTPS
    tutorial nginx howto Wednesday, May 15, 2013
  • Three Ways to Protect EC2 Instances from Accidental Termination and Loss of Data
    amazon howto aws Thursday, August 23, 2012
  • Creating consistent backups for EBS with EXT4 and quota
    aws backup snapshot howto Thursday, August 23, 2012
  • howto bash osx Saturday, January 29, 2011

Nginx Redirect HTTP to HTTPS

Nginx Redirect HTTP to HTTPS

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;         ...