<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=KOI8-R" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Igor Sysoev schrieb:
<blockquote cite="mid:20080819111818.GB65841@rambler-co.ru" type="cite">
  <pre wrap="">On Tue, Aug 19, 2008 at 01:05:33AM +0200, Samuel Vogel wrote:
  </pre>
  <blockquote type="cite">
    <pre wrap="">I am planning on using nginx to be a reverse proxy infront of more than 
ten real servers, each containing 10 virtual machines. These virtual 
machines all contain the same setup lamp setup hosting about a 100 
users/domains each.
This means as a total we have about 10.000 domains. As we provide low 
cost shared hosting on low cost servers, we can not switch the ip of a 
virtual machine between servers. So when we migrate a VM to a different 
physical server because of load reasons, it's IP changes as well.

This is why we would like to use nginx infront as a reverse proxy. It 
would then always know the corresponding IP for a virtual machine and 
reroute the requests.

With my current knowledge of nginx I would setup a virtual host for 
every VM we have and add all the domains it contains into the 
server_name variable. This would mean 100 virtual host with very long 
server_names, each containing 100 domains.

Additionally I would like to use the reverse proxy setup to sanitize the 
requests, protect the VMs from dos attacks and if a VM goes down route 
all requests to this VM to a static file like "we'll be back soon".

My question is, would this configuration be maintainable with nginx? Can 
it cope with long server_names and a rather strange setup like this? Or 
will it degrade my performance too much?
    </pre>
  </blockquote>
  <pre wrap=""><!---->
nginx searchs server names via hash, so it will be quick opration.
nginx does primitive only sanitize.
As to "we'll be back soon", you need to use

     error_page  502 504  /back.html;
  </pre>
</blockquote>
<br>
Great! So even more than 10.000 domains would not matter and there is
no size limit to server_name?<br>
<br>
As for the "we'll be back soon" page, I thought I'd put the real server
(VM) and a server only containing this error page into an upstream
section and mark the error page server as backup.<br>
But if the 502 and 504 errors achieve the same effect, this makes
things easier!<br>
<br>
Greatly appreciate it,<br>
Samy<br>
<br>
</body>
</html>