Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

And what are performance implications? Is it practical to host tens of thousands of vhosts on one Nginx instance? How much would the increased latency be?

We plan to offer custom domains for users, and to assign different chroot per user and to serve static assets like js/css directly from nginx, we want to host as many users per nginx instance as possible.

share|improve this question
up vote 1 down vote accepted

If you don't require dynamic content, fastcgi daemons etcetera, unlimited vhosts can be as simple as this SF answer.

server_name *.dom.tld;
root /var/www/$http_host/public;

In that case, your first bottleneck will likely be the filesystem, not Nginx.

Also note that major reverse proxies such as Cloudflare use (a modified version of) Nginx, so it sounds plausible to do.

share|improve this answer
Thanks! Is "server_name *;" an acceptable value? When we use custom domains, not subdomains. Then it's a perfect solution! – kenn Nov 9 '14 at 18:48
Yes, see also: So I wonder, How come this question is still relevant after almost 2 years? ;) – Willem Nov 12 '14 at 12:30
Took another route at the time - now I'm commenting out of pure interest. :) – kenn Nov 13 '14 at 19:58

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.