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
Copy file name to clipboardExpand all lines: README.md
+22Lines changed: 22 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -50,6 +50,28 @@ reverse_proxy_options sets global options for all reverse proxies. Available opt
50
50
*`:matching` is a global only option, if set to :first the first matched url will be requested (no ambigous error). Default: :all.
51
51
*`:timeout` seconds to timout the requests
52
52
53
+
### Sample usage in a Ruby on Rails app
54
+
55
+
Rails 3 or less:
56
+
57
+
```ruby
58
+
# config/application.rb
59
+
config.middleware.insert_before(Rack::Lock, Rack::ReverseProxy) do
60
+
reverse_proxy_options preserve_host:true
61
+
reverse_proxy '/wiki', 'http://wiki.example.com/'
62
+
end
63
+
```
64
+
65
+
Rails 4+ or if you use `config.threadsafe`, you'll need to `insert_before(Rack::Runtime, Rack::ReverseProxy)` as `Rack::Lock` does not exist when `config.allow_concurrency == true`:
66
+
67
+
```ruby
68
+
# config/application.rb
69
+
config.middleware.insert_before(Rack::Runtime, Rack::ReverseProxy) do
0 commit comments