<div dir="ltr">You can chain two maps to get a logical and:<div><br></div><div><span style="font-family:arial,sans-serif;font-size:13px">map $request_method $is_get {</span><br style="font-family:arial,sans-serif;font-size:13px">
<span style="font-family:arial,sans-serif;font-size:13px"> default 0;</span><br style="font-family:arial,sans-serif;font-size:13px"><span style="font-family:arial,sans-serif;font-size:13px"> GET 1;</span><br style="font-family:arial,sans-serif;font-size:13px">
<span style="font-family:arial,sans-serif;font-size:13px">}</span></div><div><span style="font-family:arial,sans-serif;font-size:13px"><br></span></div><div><span style="font-family:arial,sans-serif;font-size:13px">map $http_cache_bypass $bypass_cache {</span></div>
<div><span style="font-family:arial,sans-serif;font-size:13px"> default $is_get;</span><br></div><div><span style="font-family:arial,sans-serif;font-size:13px"> "" 0;</span></div><div><span style="font-family:arial,sans-serif;font-size:13px">}</span></div>
<div><br style="font-family:arial,sans-serif;font-size:13px"><span style="font-family:arial,sans-serif;font-size:13px">proxy_cache_methods POST;</span><br style="font-family:arial,sans-serif;font-size:13px"><span style="font-family:arial,sans-serif;font-size:13px">proxy_cache_bypass $bypass_cache;</span><br>
</div><div><span style="font-family:arial,sans-serif;font-size:13px"><br></span></div><div><span style="font-family:arial,sans-serif;font-size:13px"># note the lack of : after default in the maps, it's incorrect to have it there like your original map did</span></div>
</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Jan 24, 2014 at 10:03 PM, B.R. <span dir="ltr"><<a href="mailto:reallfqq-nginx@yahoo.fr" target="_blank">reallfqq-nginx@yahoo.fr</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_default" style="font-size:small;color:rgb(51,51,153)">Hello,<br></div><div class="gmail_extra">
<br><div class="gmail_quote"><div class="im">On Sat, Jan 25, 2014 at 3:40 AM, Jeroen Ooms <span dir="ltr"><<a href="mailto:jeroen.ooms@stat.ucla.edu" target="_blank">jeroen.ooms@stat.ucla.edu</a>></span> wrote:<br>
</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class="im">
This looks like a fragile solution. You're basically simulating an<br>
"if", but I don't think we should assume that nginx will resolve all<br>
maps in the defined order, as would be using "if".<br>
<br>
</div><div class="gmail_default" style="font-size:small;color:rgb(51,51,153);display:inline">*snip*<br></div><div class="im">
<br>
Maybe someone from the nginx team can comment if this is a viable solution?<br>
</div></blockquote></div><br><div class="gmail_default" style="font-size:small;color:rgb(51,51,153)">You explicited clearly you wanted to avoid if/and logic in your message subject (one could wonder why since there appears to be no other trivial solution)...<br>
</div><div class="gmail_default" style="font-size:small;color:rgb(51,51,153)">In the end, since proxy_cache_bypass doc clearly state that it works based on an OR logic, what you wish won't happen magically.<br><br></div>
<div class="gmail_default" style="font-size:small;color:rgb(51,51,153)">With those conditions set, I hardly see something that won't look edgy...<br></div><br><div class="gmail_default" style="font-size:small;color:rgb(51,51,153)">
Maybe someone else could help you better.<br></div><div class="gmail_default" style="font-size:small;color:rgb(51,51,153)">Good luck,<br></div><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>_______________________________________________<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></blockquote></div><br></div>