Welcome! Log In Create A New Profile

Advanced

Re: Deny referrer using map directive

Francis Daly
May 04, 2015 04:24AM
On Mon, May 04, 2015 at 11:43:10AM +0700, Dewangga wrote:

Hi there,

> map $http_referer $badboys {
> hostnames;
> default 0;
> "~*hitleap.com" 1;
> }

For info:

This should work as-is; but when using "hostnames", you probably don't
need the regex match. Just ".hitleap.com" will do what you possibly
want. (It is not the same: both will block a.hitleap.com; but only one
will block ahitleap.com or hitleap.com.a.)

> but, if I tried to access them using given referral, still got HTTP 200.
> $ curl -I https://domain.name -L -e hitleap.com | grep 200

It works for me, using http: (because I don't have a test https: server
to hand). What happens when you leave all of the "...skip..." parts empty?

> Is there any additional configuration needed?

Do your logs show that this request was handled in the server{} block
that you think it was handled in?

f
--
Francis Daly francis@daoine.org

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

Deny referrer using map directive

dewanggaba May 04, 2015 12:44AM

Re: Deny referrer using map directive

Francis Daly May 04, 2015 04:24AM

Re: Deny referrer using map directive

dewanggaba May 04, 2015 04:30AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 221
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