Answer the question
In order to leave comments, you need to log in
How to build links in Sinatra considering reverse proxy?
The Sinatra documentation for the url helper says:
To form a URL, you should use the url method, for example in Haml: This method takes into account Rack reverse proxies and routers if they are present.%a{:href => url('/foo')} foo
Answer the question
In order to leave comments, you need to log in
The way "on the forehead" is to change the information in env before processing the request.
Something like this. It is possible at the Rack level, it is possible at the application level.
before do
env['PATH_INFO'].sub!(/^\/blah/, '')
end
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question