oh cool thanks i get what you mean. thanks for the help! Regards, Ron
On Sun, Jul 28, 2013 at 5:07 PM, edogawaconan <m...@myconan.net> wrote: > On Sun, Jul 28, 2013 at 11:55 AM, ron ramos <nha...@gmail.com> wrote: > > Hi All, > > > > Been trying to block bots from accessing a URI that has a query_string > > "action=get_it", i tried below > > > > > > location ~* \?(action=get_it)$ { > > > > if ( $http_user_agent ~ > > (crawl|Googlebot|Slurp|spider|bingbot|tracker|click|parser|spider)) { > > > > return 404; > > > > break; > > > > } > > > > } > > > > i just learned that location does not match query string, if i do the > is_arg > > i cant do nested if, anyone able to do this before? > > > > TIA. > > > > I don't remember the exact syntax but something like this should work: > > if ($arg_action = get_it) { set $no_bot 1; } > if ($http_user_agent ~ <keys>) { set $is_bot 1; } > if ($no_bot$is_bot = 11) { return 404; } > > -- > O< ascii ribbon campaign - stop html mail - www.asciiribbon.org > > _______________________________________________ > nginx mailing list > nginx@nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx >
_______________________________________________ nginx mailing list nginx@nginx.org http://mailman.nginx.org/mailman/listinfo/nginx