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-subdomains-to-www-site-com
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