Track which mongrel handled a request December 26, 2007
Posted by John Dewey in Code, Configuration, Example, Mongrel, Rails, WebServers.trackback
I wrote a plugin which collects system information, and returns the data as HTML comments at the bottom of the page. When running multi-system / multi-Mongrel environments, knowing which server and Mongrel handled a request is paramount.
Unfortunately, getting a handle on this information is difficult, since ‘request.port’, ‘request.env['HTTP_HOST'], and ‘request.env['SERVER_PORT'], display the origin port, when your Mongrels are behind a reverse proxy.
Ezra clued me into a nice hack.You can add the following code to environment.rb, or in our case the plugin’s init.rb.
Comments»
No comments yet — be the first.