Hi ,
I am looking for a lua solution where on basis of a paramter on request I want to redirect to specific url and second server on else case-
My Script -
access_by_lua_block {
if ngx.var.request_method == "POST" then
ngx.req.read_body()
local data = "">
if string.match(data,"FIT_TEST") then
return ngx.redirect("serverUrl" .. ngx.var.request_uri)
end
end
return ngx.redirect("serverUrl2" .. ngx.var.request_uri)