Posts

Showing posts from September, 2016

Dynamic resolution of upstream servers in nginx

UPDATE: This approach was superseded by the proxying through systemd-socket-proxyd approach.Many of my clients are running application stacks consisting of nginx plus some kind of scripting engine behind it (be it PHP, Ruby, or something else). The architecture I designed for this kind of workload involves at least two load balancers: the external, frontend load balancer that serves the web requests from visitors and the internal, backend load balancer that distributes load between the backends.Everything looks great when you implement this using "in-house" infrastructure where you control most of the networking aspects. However, the tendency is that most enterprises are moving to the cloud providers and with that we lose some control. Specifically, often the cloud providers define their load-balancers as auto-scaleing entities that change their IP addresses depending on the scale-in/out activity.Unfortunately, the community version of nginx does not know how to dynamica…