Hello,
Given my nginx (as a http reverse proxy) has two backend servers, one
is 192.168.1.1, another is 192.168.1.2
When a request income, I want to pass it to the both application
servers.
Can I setup nginx doing it? and how?
Thanks.
Hello,
Given my nginx (as a http reverse proxy) has two backend servers, one
is 192.168.1.1, another is 192.168.1.2
When a request income, I want to pass it to the both application
servers.
Can I setup nginx doing it? and how?
Thanks.
You should look at HttpLuaModule:
http://wiki.nginx.org/HttpLuaModule#ngx.location.capture_multi
Example:
– construct the requests table
local reqs = {}
table.insert(reqs, { “/mysql” })
table.insert(reqs, { “/postgres” })
table.insert(reqs, { “/redis” })
table.insert(reqs, { “/memcached” })
-- issue all the requests at once and wait until they all return
local resps = { ngx.location.capture_multi(reqs) }
-- loop over the responses table
for i, resp in ipairs(resps) do
-- process the response table "resp"
end
Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,213808,214322#msg-214322
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs