GithubHelp home page GithubHelp logo

rack-reverse-proxy's People

Contributors

brianewing avatar carlhoerberg avatar ehlertij avatar hubertlepicki avatar jaswope avatar jjthrash avatar joliss avatar josephruscio avatar jphenow avatar markbates avatar natejgreene avatar pex avatar rmanalan avatar sinm avatar waterlink avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rack-reverse-proxy's Issues

New maintainer needed ?

Guys,

this is small cool project yet current maintainer clearly has no time/will to maintain it.

Is there someone better suited for the job who would like to take over?

If not, I'd be happy to help as it looks like I'll be using this library more and more in upcoming months.

Support for forwarding user supplied http basic user/password

Hello,
my old API website requires http basic auth (or oauth) in order for a user to gain access to the page.

In my new Rails app I mounted rack-reverse-proxy but I'd like to know if it's possible to also forward the custom user/password combo the user is asking my app.

Is that possible?

Preserve RequestHeaders

Hi, I'm using this project to redirect requests in an existing heroku app that has been moved to a more powerful cluster.

Redirects occur fine but I need one of the headers that the devices are sending to heroku, to be sent to the cluster where the proxy is pointing at.

(I'm not a ruby dev so please bear with me)

config.ru (if it helps)

require 'rack/reverse_proxy'

use Rack::ReverseProxy do
  reverse_proxy_options :preserve_host => true
  reverse_proxy '/', 'http://example.com'
end

app = proc do |env|
  [ 200, {'Content-Type' => 'application/json'}, "b" ]
end

run app

Preserve body on DELETE requests

This seems to only preserve the request body on PUT and POST request methods. AFAIK, the standards do not explicitly prohibit a request body on a DELETE request, so the reverse proxy shouldn't either.

Is it possible to reverse_proxy a sitemap hosted in S3?

I have setup a rake task to refresh the sitemap of an application, and it's hosted in S3, because we're using heroku. Can I use this to reverse proxy in this case? I tried but I get an error

<Error>
  <Code>InvalidArgument</Code>
  <Message>Unsupported Authorization Type</Message>
  <ArgumentName>Authorization</ArgumentName>

:preserve_host semantics is upside-down

:preserve_host, when set to true, causes the Host header to be overridden, not to be preserved, unlike Apache's ProxyPreserveHost, which has the semantics you would expect.

In other words, given Rack app A reverse-proxying to B, with :preserve_host => false, it will send "Host: A", and with :preserve_host => true, it will send "Host: B".

It should be the other way around, i.e. false sends B and true sends A, so that the option means what it says, and to be consistent with Apache.

The default should probably be to not preserve the host, like Apache. (I'm not sure about the current default...)

url matching doesnt take into account the URL encoding

I had to create a reverse proxy for encoded_uri in this URL:

/proxy?url=encoded_uri

The configuration of the proxy:

  reverse_proxy /^\/proxy\?url=(.*)$/, "$1", :preserve_host => false

The problem is that the implementation of get_uri doesnt take into account the URL encoding of the parameter and it returns:

https%3A%2F%2Fgithub.com%2Fjaswope%2Frack-reverse-proxy%2Fissues%2Fnew

which causes an internal server error.

My fix:

class Rack::ReverseProxyMatcher

  alias_method :get_uri_without_decode, :get_uri

  def get_uri(path,env)
    puts 'this is a monkeypatched method for :get_uri'
    url = get_uri_without_decode(path,env)
    if url.path.start_with?('http%')
      url = URI.decode url.path
      url = URI(url)
    end
    url
  end
end

Can this be used to simulate round robin loadbalancing?

Just wondering if this gem could be used as a development/test load balancer that a dev could run locally. I was looking for a simple way to start two http apps and just have this toggle between the two when http requests come in.

Is it possible to show contents from the URL with sub directories?

Thank you for this great gem.
I would like to show the contents from a URL with subdirectory at the http://example.com/ (Rails app).
I configured config/application.rb as following, but this does not work.

module MyRailsApp
  class Application < Rails::Application
    config.middleware.use Rack::ReverseProxy do
      reverse_proxy_options preserve_host: true
      reverse_proxy /^\/$/, 'http://example-2.com/example-page'
    end
  end
end

But this configuration only shows "http://example-2.com/" not "http://example-2.com/example-page”.
Is this usage supported?

Assets not showing up for https

Hi,

I have reverse proxy setup for a subfolder to a wordpress blog, which is hosted on an ec2 server. Ultimate goal "https://www.example.com/blog/" The problem is the parent site is in https, so for transparency I've added openssl to the lamp stack(ec2). The problem is that the wordpress blog is not showing any assets/css.

routes:
#wordpress
match "/blog" => redirect("/blog/")

config.ru

use Rack::ReverseProxy do
reverse_proxy /^/blog(/.*)$/, 'http://xx.xx.xx.x$1', opts={:preserve_host => true}
end

xx.xx.xx.x = ip to the ec2 box with wordpress installed.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.