I hope you will forgive my asking for help on what I assume is a fairly obvious error of some sort -- but it&#39;s one I&#39;m afraid I can&#39;t figure out.<br><br>Basically, we have a cherrypy back end server that will resolve layer names to IP address, handling requests of the form:<br>
<br>&nbsp;&nbsp; /resolve?layer=test<br><br>or<br><br>&nbsp; /resolve?layer=es_layer_23<br><br>The back end server sets a memcache key/value pair so that the next time around, nginx can avoid the &quot;@cache_miss&quot; proxy pass.<br><br>
For the most part, all works well -- if I request the name of a key in the memcached, (&quot;test&quot;, for example) -- it gets returned.&nbsp; Likewise, if I request a key NOT in memcached, the request gets sent to my server.<br>
<br>However, there are a couple of classes of layers that can be handled generically:&nbsp; ANY layer starting with &quot;es_&quot; or &quot;api_&quot; will go to the same host: So no need to clutter memcached, right?&nbsp; Just convert the key so that it is identical for all such requests...<br>
<br>When I attempt to do so using the code fragment below, however, I get what I believe is unusual behavior -- requests for anything starting with &quot;es_&quot; or &quot;api_&quot; return nothing -- no HTTP headers, no nothing.<br>
<br>Any thoughts on why?<br><br>Thanks,<br><br>--Tom<br><br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; location /resolve {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; default_type&nbsp; text/html;<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; set $memcached_key &quot;api:/resolve?$args&quot;;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if ($args ~ &quot;layer=es_&quot;) {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; set $memcached_key &quot;api:/resolve?layer=es_&quot;;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if ($args ~ &quot;layer=api_&quot;) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; set $memcached_key &quot;api:/resolve?layer=api_&quot;;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; memcached_pass localhost:11211;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; error_page 404 = @cache_miss;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br><br>