I need block all http connections, who have referrer click2dad.net. I write in mysite.conf:
location / { valid_referers ~.*http://click2dad\\.net.*;
Maybe you can try this config:
location / { valid_referers ~click2dad.net; if ($invalid_referer){ return 403; } try_files $uri $uri/ /index.php?$args; }
Anyway, the right answer is just in this document. http://nginx.org/en/docs/http/ngx_http_referer_module.html