3 messages in ru.sysoev.nginxRe: How to write this rewrite?
FromSent OnAttachments
ChanceyJul 8, 2009 6:48 pm 
Igor SysoevJul 9, 2009 12:02 am 
ChanceyJul 9, 2009 12:34 am 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:Re: How to write this rewrite?Actions...
From:Igor Sysoev (is@rambler-co.ru)
Date:Jul 9, 2009 12:02:21 am
List:ru.sysoev.nginx

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)$ { }