Welcome! Log In Create A New Profile

Advanced

Re: correct usage of proxy_set_header?

Maxim Dounin
February 14, 2014 07:06AM
Hello!

On Thu, Feb 13, 2014 at 05:34:44PM -0500, eN_Joy wrote:

> Hello all!
> I have configured a location that acts list a transparent proxying cache:
>
>
>
> location /get
> {
> set $hostx "";
> set $addrs "";
> if ( $uri ~ "^/get/http./+([^/]+)/(.+)$") {
> set $hostx $1;
> set $addrs $2;
> }
> resolver 8.8.8.8;
> proxy_set_header Referer " ";
> proxy_pass http://$hostx/$addrs;
> proxy_redirect off;
> access_log /var/log/nginx/get_access.log;
> }
>
> Basically when i browser to:
>
> http://mysite.com/get/http://foo.com/bar/some.html
>
> it'll get:
> http://foo.com/bar/some.html
>
> The code indeed works that way, except that the directive `proxy_set_header
> referer " "` is ignored. No matter what value I supply there (in the code
> above, empty), my get_access.log will always show the referer being the
> original refering page?

The proxy_set_header directive controls headers sent to a proxied
server. It has nothing to do with what's logged to access log on
your server. Try looking into logs of the proxied server instead.

--
Maxim Dounin
http://nginx.org/

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

correct usage of proxy_set_header?

eN_Joy February 13, 2014 05:34PM

Re: correct usage of proxy_set_header?

Maxim Dounin February 14, 2014 07:06AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 121
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready