Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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

1 Answer 1

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 at 18:48
    
Yes, see also: nginx.org/en/docs/http/server_names.html So I wonder, How come this question is still relevant after almost 2 years? ;) –  Willem Nov 12 at 12:30
    
Took another route at the time - now I'm commenting out of pure interest. :) –  kenn Nov 13 at 19:58

Your Answer

 
discard

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.