Skip to content

Instantly share code, notes, and snippets.

@techgaun
Created June 28, 2015 18:24
Show Gist options
  • Select an option

  • Save techgaun/190195d237eb0b25a93c to your computer and use it in GitHub Desktop.

Select an option

Save techgaun/190195d237eb0b25a93c to your computer and use it in GitHub Desktop.
Redirect all http domains to https
server {
listen 80 default deferred;
server_name domain.tld;
return 301 https://$host$request_uri; # $host - http://wiki.nginx.org/HttpCoreModule#.24host
# $host does not include port
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment