Redirect to same server with different port

I'm trying to set up a route to redirect to my monit interface, but I'm
not sure how to do it. what I'd like is my
to redirect to .
I tried:

get "/monit" => redirect("#{request.protocol}#{}:2812")

in my config.rb, but it doesn't seem to know about request, base_url or
anything else I can find.
Any help is greatly appreciated!

Using double-quotes here will not do what you want - they get evaluated when the routes file is loaded, not per-request. For this case, the block form of redirect is probably what you want:

get 'jokes/:number', to: redirect { |params, request  |
path = (params[:number].to_i.even? ? "wheres-the-beef" : "i-love-lamp"  )

See the docs for ActionDispatch::Routing::Redirection for more info.

–Matt Jones