0

Is it possible to mirror the HTTP Traffic to a separate server to perform independent process (no response needed) while at the same time serving the original requests?

Preferably I would like to do it using built in directives from nginx. Something like this.

2 Answers2

0

It may be possible in Nginx with post_action (found using Google search). You could also consider using GOR to do this.

Some kind of log file processing could be simpler, either near realtime or batch.

Tim
  • 31,888
  • 7
  • 52
  • 78
-1

Not possible. HTTP requires responses both ways, you can't mirror it. If you want to you could duplicate the payloads of the HTTP messages by writing them to a queue and then copying the queue and sending it to multiple places. This is what ActiveMQ/RabbitMQ is all about.

But not just with HTTP itself.

TheFiddlerWins
  • 2,999
  • 1
  • 15
  • 22
  • I don't think they want two web servers to participate, I think they just want another to get access to the requests. A voyeuristic web server. It doesn't seem particularly complex, though it's unusual so it may require writing code if it has to be done live. – Tim Mar 28 '16 at 19:39
  • He says he wants to send it to a 2nd HTTP server in his remark. – TheFiddlerWins Mar 28 '16 at 19:58
  • I do want to send it to an HTTP server but I dont need the response from the second sever. Tim may have got the idea of what I intended to do. I will also try to take into account @TheFiddlerWins answer by studying the suggested technology. – Brian Bates Mar 29 '16 at 03:45
  • Easy enough to mirror incoming tcp traffic on port 80, assuming it's not encrypted. Look at netcat ("nc") . – TheFiddlerWins Mar 30 '16 at 19:04