8 messages in ru.sysoev.nginxRe: using two if statements together ...
FromSent OnAttachments
Andy TribolettiFeb 27, 2007 5:09 pm 
RoxisFeb 27, 2007 6:00 pm 
Andy TribolettiFeb 27, 2007 7:04 pm 
RoxisFeb 28, 2007 2:02 am 
Andy TribolettiFeb 28, 2007 1:23 pm 
RoxisFeb 28, 2007 3:16 pm 
Andy TribolettiFeb 28, 2007 9:58 pm 
Igor SysoevMar 6, 2007 1:13 pm 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:Re: using two if statements together in nginx confActions...
From:Andy Triboletti (andy@public.gmane.org)
Date:Feb 28, 2007 1:23:22 pm
List:ru.sysoev.nginx

On 2/28/07, Roxis <roxi@public.gmane.org> wrote:

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; }

Unfortunately that's not working for me because the 12345 and 987 are query params on a flash .swf file and they're not showing up in the rewrite test for the url. Thanks for the suggestions so far though!

Here is some of the debug notice output when trying to do the rewrites: 2007/02/28 11:11:28 [notice] 2989#0: *881 "^.*andy\.com.*$" matches " http://andy.com/", client: 127.0.0.1, server: localhost, URL: "/thing.swf?thing_id=987", host: "localhost", referrer: "http://andy.com/" 2007/02/28 11:11:28 [notice] 2989#0: *881 "^.*987.*$" does not match "/thing.swf", client: 127.0.0.1, server: localhost, URL: "/thing.swf?event_id=987", host: "localhost", referrer: "http://andy.com/"