Get Selected backend info

Maxim Dounin mdounin at
Tue Sep 2 19:55:32 UTC 2014


On Wed, Sep 03, 2014 at 12:50:27AM +0500, Aleem B wrote:

> Hello,
> I couldn't find much information other than this thread
> <> which
> is a dead-end.
> I would like to add the selected backend/upstream to an "X-Backend" header
> before dispatching the request to the backend.

You can't.  The request is created _before_ the backend server 
will be selected (and the same request may be sent to more than 
one backend server due to proxy_next_upstream).

Maxim Dounin

More information about the nginx mailing list