$arg_name as an array

Jonathan Matthews contact at jpluscplusm.com
Fri May 9 09:54:44 UTC 2014

On 9 May 2014 10:16, beatnut <nginx-forum at nginx.us> wrote:
> Hello,
> Does it possible to use $arg_name as an array?
> For example
> I've query string : ?opt[test]=1
> I'd like to get value od opt[test] but $arg_opt[test] doesn't work.
> Is there special syntax for that case?

Query strings arguments are just strings. Whatever encoding you layer
on top of those strings, in order to be able to treat them as arrays,
is entirely subjective: you could be using any one of a number of
encodings. Nginx has no mechanism to deal with this in its vanilla
setup, as far as I'm aware.

I don't know how its embedded perl or lua modules might be /able/ to
treat them, but you'd almost certainly have to /train/ them (at least
trivially) in how to understand your specific encoding: semi-colon
separated? Brackets of some kind? Some more densely packed binary
encoding which you've then had to base64 encode because of HTTP? Nginx
doesn't know this, and doesn't give you this functionality out of the


More information about the nginx mailing list