if $request_uri , then ...

Fernando Perez lists at ruby-forum.com
Tue Nov 11 13:35:55 MSK 2008


>          #  DO NOT WANT TO USE THIS METHOD (WHICH WORKS):
>          #
>          #  If the file exists as a static file serve it
>          #  directly without running all
>          #  the other rewite tests on it
>          #
>          # if (-f $request_filename) {
>          #   break;
>          # }
>          # if (!-f $request_filename) {
>          #   rewrite ^/(.+)$ /index.php?q=$1 last;
>          #   break;
>          # }
> 

I am curious about why you don't want to use this method. What's wrong 
with it?

For your regexp problem you can force the accepted extensions too:

      location ~ ^/(js|css|images|etc)/(.+)\.(png|gif|css|js)$ {
         root /var/www/domain.com/public;
         access_log off;
         expires max;
      }

This way php files will not match the regexp and will not get served.
-- 
Posted via http://www.ruby-forum.com/.





More information about the nginx mailing list