Skip to content

Instantly share code, notes, and snippets.

@kphrx
Created September 13, 2016 10:26
Show Gist options
  • Save kphrx/d3b4584ac348265467c0ec8a2ec65f58 to your computer and use it in GitHub Desktop.
Save kphrx/d3b4584ac348265467c0ec8a2ec65f58 to your computer and use it in GitHub Desktop.
## non-www to www redirect ##
server {
server_name *.hogehoge.com;
#if redirect hogehoge.com to www.hogehoge.com
#server_name .hogehoge.com;
return 301 $scheme://www.$host$request_uri;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment