Passing response from upstream server to another upstream server

Arnaud GRANAL serphen at gmail.com
Wed Nov 13 16:23:58 UTC 2013


Hi Thierry,

This is the nginx-devel mailing-list (for development and commits), I
guess you will have better luck on nginx user list
http://mailman.nginx.org/mailman/listinfo/nginx

nginx can be an upstream of another nginx (as reverse proxy).
This means that you can chain nginx [A]->nginx [B]->nginx [C]->nginx
[D] as much as you want. However the more layers you add, the more
risks you have to break the chain (in reality, you end up with tons of
opened sockets, issues with TIME_WAIT, tuning persistent connections
between instances, etc..).

Whenever possible, try to keep nginx [A] -> nginx [D] because this
makes debugging and monitoring very simple.
If you are trying to reach an internal network, you can for example
use a GRE tunnel if your problem is that [A] can't talk directly with
[D].

Arnaud.

On Tue, Nov 12, 2013 at 4:04 PM, MAGNIEN, Thierry
<thierry.magnien at sfr.com> wrote:
> Hi,
>
> I would like to achieve something like this:
> - Nginx receives request from client
> - Nginx forwards request to an upstream server and reads response
> - Nginx sends this  response to another upstream server (it will perform some content modification)
> - Nginx gets final response and sends it over to client
>
> Is there a way to achieve this by using existing modules and an adequate configuration, or do I need to write my own "double upstream" module ?
>
> Thanks a lot,
> Thierry
>
> _______________________________________________
> nginx-devel mailing list
> nginx-devel at nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx-devel



More information about the nginx-devel mailing list