How do I configure nginx correctly to work with my Sinatra app running on thin?

Solution 1:

You have to tell nginx to proxy requests to your Sinatra application. The minimum required to accomplish that is to specify a proxy_pass directive in the location block like this:

location / {
  proxy_pass http://localhost:4567;
}
        

The Nginx Reverse Proxy docs have more information on other proxy settings you might want to include.