This, of course, is possible. Nginx comes with load balancing:
upstream mysite { server www1.mysite.com; server www2.mysite.com; }
This defines 2 servers for load balancing. By default, requests will be equally distributed across all defined servers. However, you can add weights to server entries.
In your server configuration {}, you can now add the following to send incoming requests to the load balancer (for example, to load the balance of all requests for the image catalog):
location /images/ { proxy_pass http://mysite; }
See the documentation for a more detailed description.
halfdan
source share