You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a simple reverse proxy for Rack that pretty heavily rips off Rack Forwarder. It is not meant for production systems (although it may work), as the webserver fronting your app is generally much better at this sort of thing.
4
+
This is a simple reverse proxy for Rack that pretty heavily rips off Rack Forwarder. It is not meant for production systems (although it may work), as the webserver fronting your app is generally much better at this sort of thing.
5
+
6
+
## Warning
7
+
8
+
This is a **work in progress** and this fork (like others) breaks almost all test cases because of a [rack-proxy](https://github.com/ncr/rack-proxy) / [webmock](https://github.com/bblimke/webmock) issue described in [pex/rack-reverse-proxy#1](https://github.com/pex/rack-reverse-proxy/issues/1).
9
+
Rack Proxy
10
+
11
+
[Rack-proxy](https://github.com/ncr/rack-proxy) was introduced in [rack-reverse-proxy c6bbe0b](https://github.com/pex/rack-reverse-proxy/commit/c6bbe0b31a090ce81053c324581e205d8b3a5485).
5
12
6
13
## Installation
7
14
The gem is available on gemcutter. Assuming you have a recent version of Rubygems you should just be able to install it via:
Matchers can be a regex or a string. If a regex is used, you can use the subcaptures in your forwarding url by denoting them with a $.
27
+
Matchers can be a regex or a string. If a regex is used, you can use the subcaptures in your forwarding url by denoting them with a `$`.
17
28
18
-
Right now if more than one matcher matches any given route, it throws an exception for an ambiguous match. This will probably change later. If no match is found, the call is forwarded to your application.
29
+
Right now if more than one matcher matches any given route, it throws an exception for an ambiguous match. This will probably change later. If no match is found, the call is forwarded to your application.
19
30
20
31
Below is an example for configuring the middleware:
21
32
22
33
```ruby
23
34
require'rack/reverse_proxy'
24
35
25
-
use Rack::ReverseProxydo
36
+
use Rack::ReverseProxydo
26
37
# Set :preserve_host to true globally (default is true already)
27
-
reverse_proxy_options :preserve_host =>true
38
+
reverse_proxy_options preserve_host:true
28
39
29
40
# Forward the path /test* to http://example.com/test*
30
41
reverse_proxy '/test', 'http://example.com/'
31
42
32
43
# Forward the path /foo/* to http://example.com/bar/*
0 commit comments