Welcome! Log In Create A New Profile

Advanced

Nginx load balancer replicate traffic to upstream server

Posted by chucks510 
Nginx load balancer replicate traffic to upstream server
July 30, 2014 02:44AM
I have nginx loadbalancers accept Post data and send to upstream application servers (Roundrobin) using fastcgi. Now, I would like to replicate traffic to different set of cluster. How do I do that in nginx?

Post traffic --> Nginx LB --> Cluster 1
...........................|
...........................v
....................Cluster 2

Cluster 1 and 2 should receive same events.

In my case user send post traffic once and Nginx should be able to replicate (replay) traffic to Cluster 1 and 2.
Re: Nginx load balancer replicate traffic to upstream server
August 06, 2014 06:46PM
I was able to replicate using post_action module.

upstream main_upstream {
least_conn;
server 192.168.9.10:80;
keepalive 1024;
}

server {
listen 80;
server_name _;
client_body_buffer_size 1512k;
client_max_body_size 10m;

location /1/ {
fastcgi_pass main_upstream;
post_action @replayevent ;

}
# Send the post_action request to a FastCGI backend for logging.
location @replayevent {
fastcgi_pass 192.168.9.14:80;
}

Now it send data two servers.
Re: Nginx load balancer replicate traffic to upstream server
August 07, 2014 03:14PM
chucks510 Wrote:
-------------------------------------------------------
> I was able to replicate using post_action module.


post_action state.
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 239
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready