Forwarding Requests to Multiple Upstream Servers?

mike mike503 at
Thu Jul 10 00:30:50 MSD 2008

that's a neat idea. problem is, how to deal with failures etc.

you probably couldn't treat it like an all-or-nothing transaction, i assume...

On 7/9/08, piespy <piespy at> wrote:
> On 7/9/08, Sven C. Koehler <schween at> wrote:
> >  I am wondering whether it's possible from within an nginx module to
> >  forward a request to multiple upstream servers....
> You can multiply one request to go to many servers using SSI.
> Make the POST target location enable SSI, and be a document like this:
> <!--# include virtual="/server1/upload" -->
> <!--# include virtual="/server2/upload" -->
> <!--# include virtual="/server3/upload" -->
> <!--# include virtual="/server4/upload" -->
> <!--# include virtual="/server5/upload" -->
> <!--# include virtual="/server6/upload" -->
> Then each /serverN location should have the appropriate proxy_pass
> setting. You'll probably want to mark them all "internal". Only one of
> the servers should probably actually produce output, unless it's just
> something like "Upload to serverN: complete".
> Note that these subrequests will be using the GET method (since
> 0.6.26), but by default still include the original request headers and
> body. As long as your environment can deal with GETs having a request
> body (PHP had some problems with it in my case), this should do what
> you want, if you haven't yet decided on a different replication
> method.

More information about the nginx mailing list