Dummy proxy backends

Hi all,
I’m not sure if this is possible. What i want is something like this:

  1. Send all requests to both Backend A and Backend B.
  2. But discard responses received from Backend B. Only send responses
    received from Backend A to the client.

I need this for setting up a dummy downstream for testing/debugging
purposes
with live traffic.

Any help?

Harish

On Sun, Dec 13, 2009 at 12:48:15AM +0530, Harish S. wrote:

Hi all,
I’m not sure if this is possible. What i want is something like this:

  1. Send all requests to both Backend A and Backend B.
  2. But discard responses received from Backend B. Only send responses
    received from Backend A to the client.

I need this for setting up a dummy downstream for testing/debugging purposes
with live traffic.

No way.


Igor S.
http://sysoev.ru/en/

On 12.12.2009, at 22:18, Harish S. [email protected] wrote:

Any help?
I’v been thinking about kinda like this some time ago. For test
purposes only too :slight_smile:

The only nondestructive way I can imagine is to parse requests out of
access log and perform them with any tool you like: curl, lwp or even
in-browser AJAX :slight_smile:

Best regards,
Peter.

you can use sendfile to achieve this,

send to backend B first, set the x-accell-redirect header, which then
should point to the location of backend A

for example we use this pattern for authentication, additionally you can
omit the request body and rewrite the method used to access backend b

location ^~ "/_backendB" {

    proxy_connect_timeout 1;
    proxy_pass http://backendB;
    proxy_intercept_errors on;
    proxy_method GET;
    proxy_pass_request_body off;
    proxy_set_header  Content-Length  '0';
    rewrite /_backendB(.*) $1;
    internal;
    break;
}

Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,30128,30406#msg-30406