Hello!

On Sun, Jul 27, 2014 at 07:37:01AM -0400, husseingalal wrote:

> Hi,
> I wanted to ask about break flag in rewrite directive as i understand Nginx
> does not initiate a new request for the modified URI but i cant understand
> how this will be useful?

There is an example in docs, http://nginx.org/r/rewrite:

    location /download/ {
        rewrite ^(/download/.*)/media/(.*)\..*$ $1/mp3/$2.mp3 break;
        rewrite ^(/download/.*)/audio/(.*)\..*$ $1/mp3/$2.ra  break;
        return  403;
    }

The "break" flag is used here to change an URI, but keep 
processing in the already matched location.  For example, a 
request to "/download/foo/media/bar.mp3" will be mapped to the 
"/root/download/foo/mp3/bar.mp3" file, where "/root" is the 
document root in the "/download/" location.

-- 
Maxim Dounin
http://nginx.org/

_______________________________________________
nginx mailing list
[email protected]
http://mailman.nginx.org/mailman/listinfo/nginx

Reply via email to