using two if statements together in nginx conf

Roxis roxis at list.ru
Wed Feb 28 13:02:53 MSK 2007


On Wednesday 28 February 2007, Andy Triboletti wrote:
> What if I want to redirect when the referer is bob.com with args of 12345
> and also redirect if referer is andy.com with args of 987?  I tried having
> two location ~* things {} blocks ,but it is not processing both.

if ($http_referer ~ "^.*bob\.com.*$") {
    rewrite "^.*12345.*$" /disabled break;
}

if ($http_referer ~ "^.*andy\.com.*$") {
    rewrite "^.*987.*$" /disabled break;
}





More information about the nginx mailing list