Welcome! Log In Create A New Profile

Advanced

proxy_redirect vs. relative URLs from upstream

m irya
June 12, 2014 08:16AM
Hi,

I'm trying to create a sinle proxying configuration as following:

location = /proxy {
resolver 8.8.8.8;
proxy_pass $args;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP $remote_addr;
proxy_redirect "" $uri?;
}

e.g. http://example.com/proxy?http://example2.com/ would deliver the
contents/headers of http://example2.com/ . If http://example2.com/ replies
with

Location: http://example3.com/

, the client gets

Location: http://example.com/proxy?http://example3.com/

, so it works as expected. However, i've got example2.com replying with
relative Location, e.g.:

Location: /some/path

This results in client getting:

Location: http://example.com/proxy?/some/path

, something that won't work. Is there any way to make it work for client to
get

Location: http://example.com/proxy?http://example2.com/some/path

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

proxy_redirect vs. relative URLs from upstream

m irya June 12, 2014 08:16AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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