8 messages in ru.sysoev.nginxusing two if statements together in n...
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:using two if statements together in nginx confActions...
From:Andy Triboletti (andy@public.gmane.org)
Date:Feb 27, 2007 5:09:32 pm
List:ru.sysoev.nginx

Is there a way to use 2 if statements together either nested or in one line in the nginx config? Here is what I want to do

For a given location /things I want to check if a query parameter has a certain value, and I also want to check the referer and if both match then do a redirect

I tried doing this and a few other things but couldn't figure out how to chain multiple if statements together. location = /things { if ($http_referer ~* ".*bob.com.*" && $args ~* "12345") { rewrite ^/things$ /thing.disabled break;

So if someone coming from bob.com requests things?thing_id=12345 I want to send them to a disabled page. I tried checking for the query parameters in the location definition block but it didn't have the parameters.