URL rewriting: last versus break

Roxis roxis at list.ru
Fri Jul 4 00:00:47 MSD 2008


On Thursday 03 July 2008, Thomas wrote:
> Hi,
>
> I don't understand the difference between "last" and "break". Can
> someone explain me how it works or point me to some more detailed
> info?

wiki didn't help?

location / {
    rewrite ^/foo$ /foo.php last;
    rewrite ^/bar$ /bar.php break;
}

location ~ \.php$ {
    proxy_pass ...;
}

request /foo will return proxy_pass response ("location ~ \.php" will be used)
request /bar will return source code of foo.php ("location /" will be used)





More information about the nginx mailing list