block bot on uri with query_string

ron ramos nhadie at gmail.com
Sun Jul 28 02:55:52 UTC 2013


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.

Regards,

Ron
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20130728/23581f87/attachment.html>


More information about the nginx mailing list