nginx redirect doesn't work from any subdomain to www.site.com

1 post / 0 new
#1 Thu, 03/07/2013 - 07:16
klaas@dezwart.org

nginx redirect doesn't work from any subdomain to www.site.com

hi been asking this very same on stackoverflow, and keep getting answers that don't seem to work with my virtualmin nginx installation original question is http://stackoverflow.com/questions/15266253/nginx-rewrite-all-wildcard-s...

Nginx doesn't seem to recognize the server_name *.site.com; or the simplified one server_name .site.com;

the code: server { server_name *.site.com; return 301 http://www.site.com$request_uri; }

server { server_name www.site.com; [..rest of config.] }

doesn't work, sends no 301 redirect but defaults to the first defined server in nginx.conf