Skip to content

Instantly share code, notes, and snippets.

@ELLIOTTCABLE
Created December 16, 2009 03:34
Show Gist options
  • Select an option

  • Save ELLIOTTCABLE/257564 to your computer and use it in GitHub Desktop.

Select an option

Save ELLIOTTCABLE/257564 to your computer and use it in GitHub Desktop.
NginX no‐www
# Unfortunately, this is the ‘officially best and most efficient’ way to
# achieve no‐www under NginX. And yes, this had to be duplicated for each
# domain / virtual‐host.
server {
listen 80; server_name www.domain.tld;
access_log off;
rewrite ^ http://domain.tld$request_uri permanent;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment