Nginx mass dynamic virtual hosts like apache?

anagio nginx-forum at
Sun Nov 20 09:42:35 UTC 2011

Given I use this method for sub-domains

map $http_host $subdir {
default "default"; "foo"; "baz";

Is there a method to redirect any requests for sub-domains which do not
exist (404s) to a custom html/php page?

Posted at Nginx Forum:,218617,218634#msg-218634

More information about the nginx mailing list