Conditional return of proxied responses

We’re using elastic IPs yet for an auto scaling backend’s pool with
possibly hundreds of instances… Costs and other irritations add up.

I’ve implemented this and other useful extensions to apaches mod_proxy
here:

Any quick advice on doing the same in nginx?

Thanks - Neal