The nginx wiki states:
break - completes processing of current rewrite directives and non-rewrite processing continues within the current location block only.
Is this to say that:
If the rewrite pattern matches, process the rewrite (rewrite to target) but do not process any of the other rules in the location block, and process all other (cache, proxy, etc) directives in the location block?
I am talking about the break flag as per:
PATTERN TARGET FLAG
Not the "break;" directive.
UPDATE:
The scenario I was thinking of using this for is as follows, a simple location with multiple rewrites:
location /path/ {
rewrite ^/user_request_one$ /target_one;
rewrite ^/user_request_two$ /target_two;
... other directives ...
}
Perhaps I dont understand fully how nginx handles rewrites, but in the above, if target_one is matched, will nginx still test rewrite rule target_two? Would adding a break flag to target_one instruct nginx to stop parsing any further rewrite rules?
The main reason I am asking is because we have some location blocks with a number of rewrite rules and I am unsure weather nginx is testing rewrite patterns "further down" even if one is matched "near the top". These rewrites are very unique, so if one is hit, there is absolutely no reason for nginx to test any others in the same location block. We just want to make sure we are not wasting any precious cpu cycles as this is a fairly loaded server.
Hope this helps.
Thanks.