Jay Haines
August 03, 2022 08:42PM
I am trying to weed out requests for any uri that contains the string,
"announce" (no quotes). That would include

* /announce
* /announce/
* /announce.php

each with or without query strings. I have the following location blocks
in my server context:

       location ~* announce {
               return 444;

       location ~* /announce.php {
               return 444;

and my log looks good:

""       "03/Aug/2022:20:19:00 -0400"    "GET
HTTP/1.1"        "444"   "0"     "0.000"  "-"     "BitComet/"

until it doesn't:

""        "03/Aug/2022:20:24:03 -0400"    "GET
HTTP/1.1" "400"   "150"   "0.000" "-"     "-"

I have tried various location prefixes and regexes (and combinations
thereof) but can't seem to find the one that works correctly.

Thanks for any help
nginx mailing list -- nginx@nginx.org
To unsubscribe send an email to nginx-leave@nginx.org
Subject Author Posted

location regex?

Jay Haines August 03, 2022 08:42PM

Re: location regex?

Francis Daly August 04, 2022 03:34AM

Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 130
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready