If I am running a Rails 2 or Rails 3 app, is there a way to print out the web server’s name on a page (such as /foos/index)… or if Rails doesn’t have any knowledge what the server is, can Rack do it?
If I am running a Rails 2 or Rails 3 app, is there a
Share
In the CGI environment, the
SERVER_SOFTWAREvariable contains the name of the web server (and its version, unless the web server is configured to exclude this).For Rails, you can use
ENV['SERVER_SOFTWARE']anywhere to obtain the web server name.For Rack applications, you can use
env['SERVER_SOFTWARE']whereenvis available.