Passing response from upstream server to another upstream server

MAGNIEN, Thierry thierry.magnien at sfr.com
Wed Nov 13 16:30:58 UTC 2013


Hi Arnaud,

Thanks for your response but my goal is to have only one Nginx server, not chaining them.

>From what I've seen, I think I should be able to achieve this using proxy + lua module, and I'll write my own module using subrequests if performance is too low.

Regards,
Thierry

-----Message d'origine-----
De : Arnaud GRANAL [mailto:serphen at gmail.com] 
Envoyé : mercredi 13 novembre 2013 17:24
À : nginx-devel at nginx.org
Cc : MAGNIEN, Thierry
Objet : Re: Passing response from upstream server to another upstream server

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