Hashes / Arrays für $arg_PARAMETER

Hello @all,

Is it possible to define array / hashes in nginx? I have the following
idea:

nginx should check $arg_PARAMETER which is defined by an array. If the
right element in the array, then die access is permitted, otherwise
denied.

example:

the $arg_PARAMETER can have the following values:

“ab” or “bc” or cd"

if $arg_PARAMATER != array -> Access is denied, otherwise permitted

I would appreciate about a solution.

Regards,

Maik

On 24 Jul 2013 21:30, “Maik U.” [email protected] wrote:

example:

the $arg_PARAMETER can have the following values:

“ab” or “bc” or cd"

if $arg_PARAMATER != array → Access is denied, otherwise permitted

$arg_* are strings because they derive from the query string. They are
not
arrays. You can interpret these strings using any of the methods nginx
gives you.

I would appreciate about a solution.

I suggest you’ll have to concoct a solution using nginx maps with
regular
expressions. That’s a very powerful method of switching behaviours based
on
user input. Have a Google for their docs and for interesting ways of
using
them.

J

hi,

i think that you don’t understand me.

i will define an array that will check against the $arg_PARAMETER.

Example:

Array with the following Values:

array (“test”; "test2)

Query-String:

$arg_user = “test”

if the $arg_PARAMETER match with on of the array values, the access to
the webseite is allow, otherwise the access is disallowed.

On 25 Jul 2013 12:34, “Maik U.” [email protected] wrote:

hi,

i think that you don’t understand me.

I understand you just fine. You want to use the nginx config language in
a
way it can’t be, because it’s not a general purpose language and the
implementors didn’t put in the specific feature you want to use. I’ve
given
you a pointer towards the nginx-y way of achieving the end result you’ve
described.

HTH,
J

On Thu, Jul 25, 2013 at 8:34 PM, Maik U. [email protected]
wrote:

array (“test”; "test2)

Query-String:

Website Domain Names, Online Stores & Hosting - Domain.com

$arg_user = “test”

if the $arg_PARAMETER match with on of the array values, the access to
the webseite is allow, otherwise the access is disallowed.

Something like this should work:

map $arg_user $allowed {
default 0;
test 1;
test2 1;
}


O< ascii ribbon campaign - stop html mail - www.asciiribbon.org