Hi All,
I am calling an webapplication from nginx. I want to capture the
response
and post the response body as a post parameter to another application.
I am doing something like this
I am calling an webapplication from nginx. I want to capture the response
and post the response body as a post parameter to another application.
I am doing something like this
local maken_res = ngx.location.capture("/test", { method = ngx.HTTP_POST
,body = “name = John”})
The post goes through but receiving application does not get request
parameter.
I think you also need to pass the request header “Content-Type:
application/x-www-form-urlencoded” to your subrequest because your
“receiving application” might require that.
I was able to post the parameter from nginx by passing the arguments
using
this.
local maken_res = ngx.location.capture(“/test”, { method =
ngx.HTTP_POST,
args = { pagelayout = dev_res_encoded }});
This works only when post parameter size is less than 81568 characters.
When
the parameter size is greater than 81568, we get error 502.
is there any way to get around this limitation or is there a different
way
to post more than 81568 characters.
I was able to post the parameter from nginx by passing the arguments using
this.
local maken_res = ngx.location.capture(“/test”, { method = ngx.HTTP_POST,
args = { pagelayout = dev_res_encoded }});
You’re passing your args via URI arguments rather than POST body. See
"* args
specify the subrequest’s URI query arguments (both string value and
Lua tables are accepted)
"
This works only when post parameter size is less than 81568 characters. When
the parameter size is greater than 81568, we get error 502.
Apparently you’re hitting the URL length limit on your backend server.