I am trying to do some silly automatic configuration of a Sinatra application which would allow to use it from different sub URI depending whether it is run with Apache and Passenger, or with Thin web server.
So my question is: is it possible to find out from inside a Sinatra application what web server runs it?
You can’t (as far as I know) see if it’s running on Apache, but you can check if it’s running on Passenger:
You should be able to do the same for Thin: