Module: Configuring upstream params (eg fastcgi_param) per request

Maxim Dounin mdounin at mdounin.ru
Mon Jun 6 13:13:04 UTC 2016


Hello!

On Thu, Jun 02, 2016 at 12:05:17AM -0400, davidjb wrote:

> Anyone have any thoughts?  Even if it's just to say "this isn't possible".

When working with multiple servers within a single upstream{} 
block, nginx creates a request only once.  If a server fails, 
nginx will re-try the same request to a different server.  So it's 
not possible to supply different parameters for different servers - 
because the request is already created.

If you want to send different requests, you have to use other 
mechanisms available in nginx, such as error_page fallback.  Then 
it will be possible to create another request with different 
headers / FastCGI parameters.

-- 
Maxim Dounin
http://nginx.org/



More information about the nginx mailing list