Welcome! Log In Create A New Profile

Advanced

Re: Deny certain words

September 03, 2014 11:32AM
On Wed, Sep 3, 2014 at 5:13 PM, Grozdan <neutrino8@gmail.com> wrote:
> On Wed, Sep 3, 2014 at 5:07 PM, Steve Wilson <lists-nginx@swsystem.co.uk> wrote:
>> I've just thought of another angle for this. Is this hitting your
>> default/only site? If it's got a host header you could create a site just
>> for that that bins all requests off with a 444 and no logging.
>
> Yes, it's the only site. I will try what you suggested. Thanks!

Well, just as I went and try what you suggested I came on the nginx
docs where it says you can use 'map directive' to decide what to log
or not so I tried the below and it works

Below goes inside http { .... }

map $status $loggable {
~^444 0;
default 1;
}

and in the vhost inside server { .... } goes the below

access_log /var/log/nginx/vhost.access.log combined if=$loggable;

This completely ignores disables logging of 444 responses

>
>>
>>
>> On 02/09/2014 12:08, Grozdan wrote:
>>>
>>> Hi,
>>>
>>> Somehow my server gets hit by torrent requests which look like this:
>>>
>>> GET /?info_hash=.....
>>>
>>> after the = come long strings of seemingly random hashes torrent
>>> clients are looking for.
>>>
>>> I'd like to deny all such requests so would like if someone could
>>> provide me how to deny everything (and including) ?info_hash=
>>>
>>> I've looked all over the net at similar examples but all I tried thus
>>> far didn't work
>>>
>>> Thanks :)
>>
>>
>>
>> _______________________________________________
>> nginx mailing list
>> nginx@nginx.org
>> http://mailman.nginx.org/mailman/listinfo/nginx
>
>
>
> --
> Yours truly



--
Yours truly

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Deny certain words

microchip September 02, 2014 07:10AM

Re: Deny certain words

Steve Wilson September 02, 2014 07:18AM

Re: Deny certain words

microchip September 02, 2014 07:34AM

Re: Deny certain words

Maxim Dounin September 02, 2014 09:10AM

Re: Deny certain words

microchip September 02, 2014 12:40PM

Re: Deny certain words

Steve Wilson September 03, 2014 10:34AM

Re: Deny certain words

Steve Wilson September 03, 2014 11:08AM

Re: Deny certain words

microchip September 03, 2014 11:14AM

Re: Deny certain words

microchip September 03, 2014 11:32AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 139
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready