Problem with new Passenger Module and rewrite rules

solars nginx-forum at
Tue Apr 28 21:30:17 MSD 2009


I've got a problem, I'm trying to get the new nginx passenger module ( to work with some rewrite rules.
The cache files for a multisite app (mephisto) are located in /cache/domain.tld/

I want to rewrite the following:
/ -> /cache/
/about/ -> /cache/
/images/fu.jpg -> /cache/

my rules are basically as follows (inside the server block):

rewrite ^/$ /cache/$host/index.html break;
rewrite ^([^.]+?)/?$ /cache/$host$1.html break;

  location ~ ^/(images|javascripts|stylesheets)/ {
    if (!-e $request_filename) {
      rewrite ^/(images|javascripts|stylesheets)/(.+)$ /cache/$host/$1/$2 last;

This works fine if the cached files exist, however, if they don't in which case the passenger module should forward the request
to the actual app, it doesn't.
The app doesn't get any request.... and I don't know why...

Can anyone tell me why this happens?

Posted at Nginx Forum:,1521,1521#msg-1521

More information about the nginx mailing list