using location.capture to post a form

Yichun Zhang (agentzh) agentzh at gmail.com
Thu Sep 18 17:14:22 UTC 2014


Hello!

On Thu, Sep 18, 2014 at 9:02 AM, jpsonweb wrote:
> 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

https://github.com/openresty/lua-nginx-module#ngxlocationcapture

"* 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.

BTW, it's better to post such questions to the openresty-en mailing
list instead: https://groups.google.com/group/openresty-en

Regards,
-agentzh



More information about the nginx mailing list