According to http://wiki.nginx.org/Pitfalls#Server_Name this is the best
solution to redirect www to no-www for one domain:

server {
  server_name www.domain.com;
  return 301 $scheme://domain.com$request_uri;
}
server {
  server_name domain.com;
  [...]
}

Is there a way to do this with regex or variables? I've ~15 domains and it
would be more convenient to have only one entry "to rule them all" ;-)

Posted at Nginx Forum: 
http://forum.nginx.org/read.php?2,240622,240622#msg-240622

_______________________________________________
nginx mailing list
[email protected]
http://mailman.nginx.org/mailman/listinfo/nginx

Reply via email to