Is this proxy setup realizable?

Samuel Vogel samydelux at gmail.com
Wed Aug 20 03:18:05 MSD 2008


Igor Sysoev schrieb:
> On Tue, Aug 19, 2008 at 01:05:33AM +0200, Samuel Vogel wrote:
>   
>> 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?
>>     
>
> 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;
>   

Great! So even more than 10.000 domains would not matter and there is no 
size limit to server_name?

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.
But if the 502 and 504 errors achieve the same effect, this makes things 
easier!

Greatly appreciate it,
Samy

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://nginx.org/pipermail/nginx/attachments/20080820/daf7dfd8/attachment.html>


More information about the nginx mailing list