Thank You<br><br><div class="gmail_quote">On Tue, Feb 17, 2009 at 9:22 AM, Igor Sysoev <span dir="ltr"><<a href="mailto:is@rambler-co.ru">is@rambler-co.ru</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div><div></div><div class="Wj3C7c">On Tue, Feb 17, 2009 at 07:48:30AM -0700, Paul Greenwood wrote:<br>
<br>
> Are the rewrite rules processed in the order they are listed in the<br>
> nginx.conf file or does nginx put them in the correct order when nginx is<br>
> started up?<br>
<br>
</div></div>nginx processes if/set/rewrite in following order:<br>
<br>
1) server level rules;<br>
2) then locaiton level rules;<br>
if a matching rewrite rule has no break flag,<br>
then nginx searches a new location and go to (2),<br>
i.e. runs location level rules.<br>
<br>
On given level rules are processed in the order they are listed.<br>
<br>
Example for request "/":<br>
<br>
server {<br>
<br>
rule1<br>
<br>
location / {<br>
rule3<br>
rule4<br>
}<br>
<br>
location ~ \.php$ {<br>
rule5<br>
}<br>
<br>
rule2<br>
<br>
rule1, rule2,<br>
rule3, rule4; rule4 rewrites to index.php;<br>
rule5<br>
<font color="#888888"><br>
<br>
--<br>
Igor Sysoev<br>
<a href="http://sysoev.ru/en/" target="_blank">http://sysoev.ru/en/</a><br>
<br>
</font></blockquote></div><br>