I have a need to adjust a nginx install doing reverse proxy to a single
server now to adjust it to send all requests it receives to two
different
upstream servers.
I was thinking I could do it with the configuration below, but I wasn’t
sure if that would work and I’d have to use re-write rules instead.
upstream original_upstream {
server
}
upstream new_upstream {
server
}
I have a need to adjust a nginx install doing reverse proxy to a
single server now to adjust it to send all requests it receives to two
different upstream servers.
do you mean
a) send each request to both?
b) send each request to one or the other (like load balancing)
a) is not possible, simply because of the basics of proxying and http
(there would be 2 http responses mixed into 1 connection)
b) can be done with 1 / location but adding another address to the
upstream block:
If you don’t care about sending the upstream response back to the
client, or want to pick one of the two responses to send back
then you can use the nginx lua module to perform some obscure
functionality… it’s quite a bit more advanced but something you might
want to look into
however the response would be fully buffered before it could be sent to
client, so may be quite a delay and a memory hog if it’s something large
On Tue, Jun 17, 2014 at 3:09 PM, Eric Feldhusen wrote:
I’m looking for a way to mirror my production site traffic to a development
environment, so that I have nearly identical traffic going to both to work
through some optimization issues that are hard to do without the load, which
is just incoming data.
Sounds like a perfect use case for the tcpcopy tool:
I’m looking for a way to mirror my production site traffic to a
development
environment, so that I have nearly identical traffic going to both to
work
through some optimization issues that are hard to do without the load,
which is just incoming data.
Eric
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.