Quantcast
Channel: Nginx Forum - Nginx Mailing List - English
Viewing all articles
Browse latest Browse all 7229

proxy_redirect vs. relative URLs from upstream (no replies)

$
0
0
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

Viewing all articles
Browse latest Browse all 7229

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>