spam prevention - Nginx block from referrer -


i need block http connections, have referrer click2dad.net. write in mysite.conf:

 location / {             valid_referers ~.*http://click2dad\.net.*;             if ($invalid_referer = ''){                     return 403;             }             try_files       $uri    $uri/   /index.php?$args;     } 

but still see in nginx logs:

http/1.1" 200 26984 "http://click2dad.net/view/vuhfce4ugtsb0sokerhgmvpxcmxszu"  

200, not 403

as correct block clients click2dad.net ?

it should noted expression matched against text starting after “http://” or “https://” http://nginx.org/en/docs/http/ngx_http_referer_module.html

correct config:

 location / {             valid_referers click2dad.net*;             if ($invalid_referer = ''){                     return 403;             }             try_files       $uri    $uri/   /index.php?$args;     } 

Comments

Popular posts from this blog

database - VFP Grid + SQL server 2008 - grid not showing correctly -

jquery - Set jPicker field to empty value -

.htaccess - htaccess convert request to clean url and add slash at the end of the url -