27
Sep

Static files with Nginx + Passenger

Normally, when you setup Nginx and Passenger to serve your rails application, all static files are served by Nginx without hitting Passenger. What really happens is that all static files that do exist are served by Nginx and the rest are passed on to mongrel.

For example http://www.mydomain.com/javascripts/prototype.js will be served by Nginx , but http://www.mydomain.com/javascripts/iamastupidrobot.js will continue to Passenger going all the way through the Rails stack. Instead of a simple 1ms nginx process , you get a full stack rails request with a route recognition error. Not good

Read more »

posted by gchatz 51 comments nginx rails