These forums are locked and archived, but all topics have been migrated to the new forum. You can search for this topic on the new forum: Search for nginx redirect doesn't work from any subdomain to www.site.com on the new forum.
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