rack-reverse-proxy icon indicating copy to clipboard operation
rack-reverse-proxy copied to clipboard

The proxy is redirecting to the root domain of the forwarded address.

Open jonathan-mui opened this issue 12 years ago • 4 comments

I have a domain "https://www.example.com".
I've setup my config.ru to do the simple forward shown in the wiki

reverse_proxy /^\/blog(\/*.*)$/, 'http://myblog.tumblr.com$1'

However, when I try to visit "https://www.example.com/blog", it redirects to "https://www.tumblr.com". Is this expected?

jonathan-mui avatar Aug 22 '12 09:08 jonathan-mui

Check the Location header in the redirect you are receiving. rack-reverse-proxy does not rewrite those, and if a full URL is in the Location header (and not a path), you'll get this issue.

jaswope avatar Aug 24 '12 14:08 jaswope

I'm facing this issue. My Location header is a full URL. How can I make my app response only the path for this redirect?

fearenales avatar Sep 22 '14 19:09 fearenales

I am also facing this issue. What shall i do to avoid this issue.

Thanks for help in advance

kurianm avatar Jun 11 '15 10:06 kurianm

For anyone having same issue, as I do: use reverse_proxy_options replace_response_host: true, along with other options.

zharikovpro avatar Oct 01 '16 13:10 zharikovpro