I hope you will forgive my asking for help on what I assume is a fairly obvious error of some sort -- but it's one I'm afraid I can'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> /resolve?layer=test<br><br>or<br><br> /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 "@cache_miss" proxy pass.<br><br>
For the most part, all works well -- if I request the name of a key in the memcached, ("test", for example) -- it gets returned. 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: ANY layer starting with "es_" or "api_" will go to the same host: So no need to clutter memcached, right? 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 "es_" or "api_" return nothing -- no HTTP headers, no nothing.<br>
<br>Any thoughts on why?<br><br>Thanks,<br><br>--Tom<br><br><br> location /resolve {<br> default_type text/html;<br><br> set $memcached_key "api:/resolve?$args";<br> if ($args ~ "layer=es_") {<br>
set $memcached_key "api:/resolve?layer=es_";<br> }<br> if ($args ~ "layer=api_") {<br> set $memcached_key "api:/resolve?layer=api_";<br>
}<br> memcached_pass localhost:11211;<br> error_page 404 = @cache_miss;<br> }<br><br>