Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handling relative urls #21

Open
mperejda opened this issue Nov 21, 2015 · 2 comments
Open

Handling relative urls #21

mperejda opened this issue Nov 21, 2015 · 2 comments

Comments

@mperejda
Copy link

Is it possible to handle relative URLs from the same domain using rack-reverse-proxy?

e.g.

config/application.rb

config.middleware.insert_before(Rack::Runtime, Rack::ReverseProxy) do
reverse_proxy_options preserve_host: true
reverse_proxy '/wiki', 'http://wiki.example.com/'
reverse_proxy '/wiki/about', 'http://wiki.example.com/about'
end

@maxilev
Copy link
Contributor

maxilev commented Mar 2, 2016

Sure:

# config/application.rb
config.middleware.insert_before(Rack::Runtime, Rack::ReverseProxy) do
  reverse_proxy_options preserve_host: true
  reverse_proxy /^\/wiki(\/.*)$/, 'http://wiki.example.com$1'
end

@matheusportela
Copy link

This issue should be closed, right?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants