conditional expression

173279834462 nginx-forum at forum.nginx.org
Sun Mar 5 16:31:32 UTC 2017


Works for me (so far): 

map $query_string $bad_query {
    "~[^&;]+([&;][^&;]*){1,}"                      1; # deny two or more
parameters
    "~emailaddress=[^@]+%40[^@]+"   0; # allow Thunderbird autoconf
    "~.+=.+"                                            1; # deny any other
query
    default                                              0; # allow (no
parameters)
}


if ($bad_query = 1) { return 444; break; }

Posted at Nginx Forum: https://forum.nginx.org/read.php?2,272758,272764#msg-272764



More information about the nginx mailing list