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