http-array-var #

array-var-nginx-module - Add support for array-typed variables to nginx config files

Source: upstream source

Directives

array_join #

syntax: array_join 2 args;  ·  context: http, server, location, server-if, location-if

Table of Contents ================= Name Status Synopsis Description Directives array_split array_join array_map array_map_op Installation Building as a dynamic module Compatibility Source Repository Getting involved Author Copyright & License * See Also Status ====== This module is production ready.

Example

location /foo {
    array_split ',' $arg_files to=$array;

    # use the set_quote_sql_str directive in the ngx_set_misc
    # module to map to each element in the array $array:
    array_map_op set_quote_sql_str $array;

    array_map "name = $array_it" $array;

    array_join ' or ' $array to=$sql_condition;

    # well, we could feed it to ngx_drizzle to talk to MySQL, for example ;)
    echo "select * from files where $sql_condition";
}

↑ back to index