Welcome! Log In Create A New Profile

Advanced

Rewrite http_referer

March 30, 2009 05:16PM
Hi, i want to catch request from a determinate referer website and redirect it to my root path.

I try this:

if ($http_referer ~* "my_referer.com"){
rewrite (.*) / redirect;
}

But when i did't firefox say me that the request is in a neverending loop.
So i need to rewrite the request referer header before redirect it.

I tried it like this:

if ($http_referer ~* "my_referer.com"){
rewrite (.*) / reset_header redirect;
}

location /reset_header{
proxy_set_header Referer "";
rewrite (.*) / redirect;
}

But i don't get any results.

Any suggestion? Thanxs!!
Subject Author Posted

Rewrite http_referer

n3uro5i5 March 30, 2009 05:16PM

Re: Rewrite http_referer

Maxim Dounin March 30, 2009 05:39PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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