<div dir="ltr"><div class="gmail_default" style="font-size:small;color:rgb(51,51,153)">Chained maps maybe?</div><br><div class="gmail_default" style="font-size:small;color:rgb(51,51,153)">http {<br></div><div class="gmail_default" style="font-size:small;color:rgb(51,51,153)"> map $arg_option $step2 {<br></div><div class="gmail_default" style="font-size:small;color:rgb(51,51,153)"> default 1;<br></div><div class="gmail_default" style="font-size:small;color:rgb(51,51,153)"> com_hwdmediashare $arg_task;<br></div><div class="gmail_default" style="font-size:small;color:rgb(51,51,153)"> }<br><br></div><div class="gmail_default" style="font-size:small;color:rgb(51,51,153)"> map $step2 $step3 {<br></div><div class="gmail_default" style="font-size:small;color:rgb(51,51,153)"> default 1;<br></div><div class="gmail_default" style="font-size:small;color:rgb(51,51,153)"> addmedia.upload $request;<br></div><div class="gmail_default" style="font-size:small;color:rgb(51,51,153)"> }<br><br></div><div class="gmail_default" style="font-size:small;color:rgb(51,51,153)"> map $step3 $blocked {<br></div><div class="gmail_default" style="font-size:small;color:rgb(51,51,153)"> default 1;<br></div><div class="gmail_default" style="font-size:small;color:rgb(51,51,153)"> ~*(?:\?|&)?base64encryptedstring 0;<br></div><div class="gmail_default" style="font-size:small;color:rgb(51,51,153)"> }<br></div><div class="gmail_default" style="font-size:small;color:rgb(51,51,153)"><br></div><div class="gmail_default" style="font-size:small;color:rgb(51,51,153)"> server {<br></div><div class="gmail_default" style="font-size:small;color:rgb(51,51,153)"> location / {<br></div><div class="gmail_default" style="font-size:small;color:rgb(51,51,153)"> return 404;<br></div><div class="gmail_default" style="font-size:small;color:rgb(51,51,153)"> }<br><br></div><div class="gmail_default" style="font-size:small;color:rgb(51,51,153)"> location /index.php {<br></div><div class="gmail_default" style="font-size:small;color:rgb(51,51,153)"> if ($blocked) {<br></div><div class="gmail_default" style="font-size:small;color:rgb(51,51,153)"> return 404;<br></div><div class="gmail_default" style="font-size:small;color:rgb(51,51,153)"> }<br></div><div class="gmail_default" style="font-size:small;color:rgb(51,51,153)"> }<br><br></div><div class="gmail_default" style="font-size:small;color:rgb(51,51,153)"> location /media/com_hwdmediashare/assets/swf/Swiff.Uploader.swf {<br> }<br> }<br></div><div class="gmail_default" style="font-size:small;color:rgb(51,51,153)">}<br></div><div class="gmail_extra"><div><div class="gmail_signature"><font size="1"><span style="color:rgb(102,102,102)">---<br></span><b><span style="color:rgb(102,102,102)">B. R.</span></b><span style="color:rgb(102,102,102)"></span></font></div></div>
<br><div class="gmail_quote">On Thu, Jan 29, 2015 at 6:29 PM, itpp2012 <span dir="ltr"><<a href="mailto:nginx-forum@nginx.us" target="_blank">nginx-forum@nginx.us</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">In the map flip the 1 and 0 around, if $allowonly=1 then the IF is true<br>
(unless that's what you want).<br>
<br>
General rule for IF's; only use it to return a state.<br>
<br>
if ..... return ....<br>
continue with complex configuration items.<br>
<br>
Don't do: 'if ..... do complex things ....' (unless proceeded with Lua<br>
finishing with an nginx if....return)<br>
<br>
If you want to expand the logic what is ok and what not, have a look at my<br>
conf\nginx-simple-WAF.conf<br>
where 3 maps are combined into 1 result map.<br>
<br>
In your case you could use 2 mappings, 1 for normal requests and 1 for<br>
passed-on php requests.<br>
<br>
Posted at Nginx Forum: <a href="http://forum.nginx.org/read.php?2,256336,256339#msg-256339" target="_blank">http://forum.nginx.org/read.php?2,256336,256339#msg-256339</a><br>
<div class="HOEnZb"><div class="h5"><br>
_______________________________________________<br>
nginx mailing list<br>
<a href="mailto:nginx@nginx.org">nginx@nginx.org</a><br>
<a href="http://mailman.nginx.org/mailman/listinfo/nginx" target="_blank">http://mailman.nginx.org/mailman/listinfo/nginx</a><br>
</div></div></blockquote></div><br></div></div>