<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=utf-8" http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 8.00.6001.18783">
<STYLE>@font-face {
        font-family: 宋体;
}
@font-face {
        font-family: Verdana;
}
@font-face {
        font-family: @宋体;
}
@page Section1 {size: 595.3pt 841.9pt; margin: 72.0pt 90.0pt 72.0pt 90.0pt; layout-grid: 15.6pt; }
P.MsoNormal {
        TEXT-JUSTIFY: inter-ideograph; TEXT-ALIGN: justify; MARGIN: 0cm 0cm 0pt; FONT-FAMILY: "Times New Roman"; FONT-SIZE: 10.5pt
}
LI.MsoNormal {
        TEXT-JUSTIFY: inter-ideograph; TEXT-ALIGN: justify; MARGIN: 0cm 0cm 0pt; FONT-FAMILY: "Times New Roman"; FONT-SIZE: 10.5pt
}
DIV.MsoNormal {
        TEXT-JUSTIFY: inter-ideograph; TEXT-ALIGN: justify; MARGIN: 0cm 0cm 0pt; FONT-FAMILY: "Times New Roman"; FONT-SIZE: 10.5pt
}
A:link {
        COLOR: blue; TEXT-DECORATION: underline
}
SPAN.MsoHyperlink {
        COLOR: blue; TEXT-DECORATION: underline
}
A:visited {
        COLOR: purple; TEXT-DECORATION: underline
}
SPAN.MsoHyperlinkFollowed {
        COLOR: purple; TEXT-DECORATION: underline
}
SPAN.EmailStyle17 {
        FONT-STYLE: normal; FONT-FAMILY: Verdana; COLOR: windowtext; FONT-WEIGHT: normal; TEXT-DECORATION: none; mso-style-type: personal-compose
}
DIV.Section1 {
        page: Section1
}
UNKNOWN {
        FONT-SIZE: 10pt
}
BLOCKQUOTE {
        MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px; MARGIN-LEFT: 2em
}
OL {
        MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px
}
UL {
        MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px
}
</STYLE>
</HEAD>
<BODY style="MARGIN: 10px; FONT-FAMILY: verdana; FONT-SIZE: 10pt">
<DIV><FONT color=#000080 size=2 face=Verdana>Thanks, i'll try it</FONT></DIV>
<DIV><FONT color=#000080 size=2 face=Verdana></FONT> </DIV>
<DIV><FONT color=#000080 size=2 face=Verdana></FONT> </DIV>
<DIV><FONT color=#c0c0c0 size=2 face=Verdana>2009-07-09 </FONT></DIV><FONT
color=#000080 size=2 face=Verdana>
<HR style="WIDTH: 100px" align=left color=#b5c4df SIZE=1>
</FONT>
<DIV><FONT color=#c0c0c0 size=2 face=Verdana><SPAN>Chancey</SPAN> </FONT></DIV>
<HR color=#b5c4df SIZE=1>
<DIV><FONT size=2 face=Verdana><STRONG>发件人:</STRONG> Igor Sysoev </FONT></DIV>
<DIV><FONT size=2 face=Verdana><STRONG>发送时间:</STRONG> 2009-07-09 15:10:56
</FONT></DIV>
<DIV><FONT size=2 face=Verdana><STRONG>收件人:</STRONG> nginx </FONT></DIV>
<DIV><FONT size=2 face=Verdana><STRONG>抄送:</STRONG> </FONT></DIV>
<DIV><FONT size=2 face=Verdana><STRONG>主题:</STRONG> Re: How to write this
rewrite? </FONT></DIV>
<DIV><FONT size=2 face=Verdana></FONT> </DIV>
<DIV><FONT size=2 face=Verdana>
<DIV>On Thu, Jul 09, 2009 at 09:48:54AM +0800, Chancey wrote:</DIV>
<DIV></DIV>
<DIV>> Hi, guys!</DIV>
<DIV>> </DIV>
<DIV>> This is Apache's format, how to write in nginx? Thanks a lot.</DIV>
<DIV>> </DIV>
<DIV>> <IfModule mod_rewrite.c></DIV>
<DIV>> RewriteEngine On</DIV>
<DIV>> RewriteCond %{REQUEST_FILENAME} !-f</DIV>
<DIV>> RewriteCond %{REQUEST_FILENAME} !-d</DIV>
<DIV>> RewriteRule !\.(js|ico|gif|jpg|png|css|cgi|html|htm|cert|swf)$ index.php</DIV>
<DIV>> php_flag always_populate_raw_post_data On</DIV>
<DIV>> </IfModule></DIV>
<DIV></DIV>
<DIV>Probably something like this:</DIV>
<DIV></DIV>
<DIV> location / {</DIV>
<DIV> try_files $uri $uri/ /index.php;</DIV>
<DIV></DIV>
<DIV> fastcgi_pass ...</DIV>
<DIV> }</DIV>
<DIV></DIV>
<DIV> location ~ \.(js|ico|gif|jpg|png|css|cgi|html|htm|cert|swf)$ {</DIV>
<DIV> }</DIV>
<DIV></DIV>
<DIV></DIV>
<DIV>-- </DIV>
<DIV>Igor Sysoev</DIV>
<DIV>http://sysoev.ru/en/</DIV>
<DIV></DIV></FONT></DIV></BODY></HTML>