Redirect arbitrary sub-domains to custom 404 when wild card A record is set?

anagio nginx-forum at
Sun Nov 20 20:59:13 UTC 2011

Is there a way to capture all requests to sub-domains which do not have
a virtual host setup, and redirect to a custom 404 page? I will have a
wild card A record setup * and all our users will have a
sub-domain If someone enters a sub-domain which
does not exist how can I redirect to a custom 404 page rather than have
it resolve since wild card is setup?


Posted at Nginx Forum:,218654,218654#msg-218654

More information about the nginx mailing list