5

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.

1 Answer 1

2

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.

4
  • Thanks! Is "server_name *;" an acceptable value? When we use custom domains, not subdomains. Then it's a perfect solution!
    – kenn
    Nov 9, 2014 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, 2014 at 12:30
  • Took another route at the time - now I'm commenting out of pure interest. :)
    – kenn
    Nov 13, 2014 at 19:58
  • @kenn which route did you ultimately take?
    – Snowball
    Mar 27, 2018 at 8:34

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .