Re: using nginx rewrite rules with sinatra

Ryan Davis <[email protected]> Tue, 24 Sep 2019 21:20:54 -0700
Newsgroups gmane.comp.lang.ruby.general
Message-ID <[email protected]>

> On Sep 24, 2019, at 13:47, Martin DeMello <[email protected]> wrote:
> 
> 2. Expose it at host:port (currently with puma, though I'm happy to change that if some other server makes it easier), and put it behind nginx with a prefix, e.g. myapp, so that the actual urls are /myapp/input and /myapp/process which rewrite to host:port/input and host:port/process

POST often responds with a redirect. Let's say /myapp/new -> /myapp/form -> /myapp/list. Who should make sure that /myapp is on the redirect if the redirect is coming from your sinatra app? It sounds like maybe a raw rack layer underneath your app to just deal with adding/removing this prefix might be the right approach, but I'm not sure it's the best idea.

What's your motivation for keeping the sinatra side ignorant of the prefix?

Unsubscribe: <mailto:[email protected]?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk>