# Repeat requests

**URL:** <https://www.ruby-forum.com/t/repeat-requests/185977>\
**Category:** NGINX\
**Created:** [March 29, 2010, 11:28pm UTC](https://www.ruby-forum.com/t/repeat-requests/185977 "2010-03-29T23:28:53Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![matthieu\_Labour](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/35a633/32.png) [@matthieu\_Labour](https://www.ruby-forum.com/u/matthieu_Labour)\
**Post date:** [March 29, 2010, 11:28pm UTC](https://www.ruby-forum.com/t/repeat-requests/185977/1 "2010-03-29T23:28:53Z")

</div>

Hi

I am new to nginx.

Can i use nginx to repeat / duplicate incoming requests …? I  
understand  
that I can use nginx to load balance … but in my use case, i need to  
duplicate the request. The incoming request should be routed to server0  
AND  
server1. Is it possible with nginx? Thank you for your help  
matt

---

<div class="post-metadata">

**Author:** ![matthieu\_Labour](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/35a633/32.png) [@matthieu\_Labour](https://www.ruby-forum.com/u/matthieu_Labour)\
**Post date:** [March 31, 2010, 4:38am UTC](https://www.ruby-forum.com/t/repeat-requests/185977/2 "2010-03-31T04:38:35Z")

</div>

On Mon, Mar 29, 2010 at 4:28 PM, matthieu Labour  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Hi
> 
> I am new to nginx.
> 
> Can i use nginx to repeat / duplicate incoming requests …? I understand  
> that I can use nginx to load balance … but in my use case, i need to  
> duplicate the request. The incoming request should be routed to server0 AND  
> server1. Is it possible with nginx? Thank you for your help  
> matt

Assuming such a thing were possible, what could you sensibly do with  
two responses to the same request? Send only the first one to the  
client? Compare if they are different and send an error if they are?

Or do you want to send only POSTS to multiple back-end systems to keep  
them in sync somehow (not a reliable mechanism, as you will miss loads  
of requests when a back-end is down)?

–  
RPM

---

<div class="post-metadata">

**Author:** ![matthieu\_Labour](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/35a633/32.png) [@matthieu\_Labour](https://www.ruby-forum.com/u/matthieu_Labour)\
**Post date:** [March 31, 2010, 2:14pm UTC](https://www.ruby-forum.com/t/repeat-requests/185977/3 "2010-03-31T14:14:25Z")

</div>

On Wed, Mar 31, 2010 at 4:37 AM, Ryan M. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> > server1. Is it possible with nginx? Thank you for your help

I tought as well the idea was pretty unusual, as it’s twice the work and  
you  
usually want to do as less as possible!  
Anyway, depending on load, expected availability, if it’ a proof of  
concept  
or something like that, I’d work on a minimal, self rolled “duplexing  
proxy”… a minimal version should be \< 100 lines of ruby or similar  
languages…but it really depends a lot on what’s needed.  
If the idea was instead just that of benchmarking two different versions  
of  
some service, I’d rather record the requested urls and then play them  
back  
to different backends.

Bye
