1

My server is spammed by multiples XXX domains, there is a lot of 404 errors in my logs and i can't find the solution to stop that.

2015/07/31 09:13:20 [error] 7070#0: *610 open() "/var/www/domain/mobile/www/www-sexvideo-shifuni.html" failed (2: No such file or directory), client: 162.158.252.53, server: m.domain.com, request: "GET /www-sexvideo-shifuni.html HTTP/1.1", host: "www.sextoysnmore.com"

As u can see i have theses errors logs each seconds..

I tried to put a file with bad referers :

map $http_referer $bad_referer {
hostnames;

default                           0;

# Put regexes for undesired referers here
"~sextoysnmore.org"             1;

}

and

if ($bad_referer) {
    return 444;
}

but there is always spam from this domain.. or others..

Anyone have a solution ?

Thanks ;)

Benjamin B.
  • 111
  • 1
  • You could put the regex for domains in the server name and then not log those or log them to a different file – Drifter104 Jul 31 '15 at 09:45

1 Answers1

1

You should list all the domains you really don't care about in one "special" server stanza, and disable all logs for those domains:

server {
  server_name www.sextoysnmore.org;

  access_log off;
  error_log /dev/null;
}
womble
  • 95,029
  • 29
  • 173
  • 228