how to rewrite this: apache to nginx

Igor Sysoev is at rambler-co.ru
Fri Aug 29 13:01:01 MSD 2008


On Fri, Aug 29, 2008 at 10:54:38AM +0200, Robert Gabriel wrote:

> Hello, I am trying to rewrite for a webpage, some stuff from apache to
> nginx, somehow I am not doing it right coz its not working... Can some
> one help me to rewrite this:
> 
> RewriteCond %{REQUEST_FILENAME} !-f
> RewriteCond %{REQUEST_FILENAME} !-d
> RewriteRule . index.php [L]
> 
> RewriteRule ^(.*/)?\.svn(/|$) - [F,L]
> RewriteRule ^(.*/)?api(/|$) - [F,L]
> RewriteRule ^(.*/)?libs(/|$) - [F,L]
> RewriteRule ^(.*/)?plugins(/|$) - [F,L]
> RewriteRule ^(.*/)?storage(/|$) - [F,L]
> RewriteRule ^(.*/)?templates(/|$) - [F,L]
> 
> to nginx?!

server {

    root ...

    location / {
        error_page  404 = /index.php;
    }

    location ~* \.php$ {
        ...
    }

    location ~* ^(.*/)?(\.svn|api|libs|plugins|storage|templates)(/|$) {
        return  403;
    }


-- 
Igor Sysoev
http://sysoev.ru/en/





More information about the nginx mailing list