How to write this rewrite?

Igor Sysoev is at rambler-co.ru
Thu Jul 9 11:02:44 MSD 2009


On Thu, Jul 09, 2009 at 09:48:54AM +0800, Chancey wrote:

> Hi, guys!
> 
> This is Apache's format, how to write in nginx?  Thanks a lot.
> 
> <IfModule mod_rewrite.c>
> RewriteEngine On
> RewriteCond %{REQUEST_FILENAME} !-f
> RewriteCond %{REQUEST_FILENAME} !-d
> RewriteRule !\.(js|ico|gif|jpg|png|css|cgi|html|htm|cert|swf)$ index.php
> php_flag always_populate_raw_post_data On
> </IfModule>

Probably something like this:

   location / {
       try_files  $uri  $uri/  /index.php;

       fastcgi_pass ...
   }

   location ~ \.(js|ico|gif|jpg|png|css|cgi|html|htm|cert|swf)$ {
   }


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





More information about the nginx mailing list