Nginx mass dynamic virtual hosts like apache?

Alexandr Gomoliako zzz at
Sun Nov 20 00:33:16 UTC 2011

On Sun, Nov 20, 2011 at 2:17 AM, anagio <nginx-forum at> wrote:
> Hi,
> In your example does that mean I would need to add entries for each
> sub-domain as needed. If that's the case, wouldn't I have to restart
> nginx each time a new entry is made? I plan to have sub-domains created
> when users register. Will I have to restart?

No, just reload, which is safe.

But if that's a problem, you can extract subdir with regex
in the same map, something like this:

    ~^(?<sub>[a-zA-Z0-9-]+)\.bar\.com$  $sub;

More information about the nginx mailing list