<div dir="ltr">Я делаю md5 uri( ну и плюс cookie если есть).<br><br><div class="gmail_quote">2008/7/16 Denis Shaposhnikov &lt;<a href="mailto:dsh@wizard.volgograd.ru">dsh@wizard.volgograd.ru</a>&gt;:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hello,<br>
<br>
Есть у меня вот такая конфигурация:<br>
<br>
 &nbsp; &nbsp; &nbsp; &nbsp;location /getfile/ {<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if ($uri ~ &quot;^/getfile/([^/]+)/(.+)&quot;) {<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;set $memcached_key &quot;$1:filestorage:/$2&quot;;<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;memcached_pass memcached;<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;expires 15m;<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;error_page 404 502 504 = @getfile;<br>
 &nbsp; &nbsp; &nbsp; &nbsp;}<br>
<br>
 &nbsp; &nbsp; &nbsp; &nbsp;location @getfile {<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;rewrite ^/getfile/([^/]+)/(.+)<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; /$1/index.cgi?rm=getfile&amp;fname=/$2? break;<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;proxy_pass <a href="http://127.0.0.1:8080" target="_blank">http://127.0.0.1:8080</a>;<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;expires 15m;<br>
 &nbsp; &nbsp; &nbsp; &nbsp;}<br>
<br>
Которая при обращение к &quot;/getfile/XXX/YYY&quot; запрашивает в memcached, а<br>
если там нет, то проксирует запрос к скрипту, который положит потом<br>
объект в memcached. Это работает. Смущает меня только использование<br>
&quot;if&quot;. Подскажите пожалуйста, это единственный способ вычислить ключ для<br>
memcached, используя части URI?<br>
<br>
Спасибо!<br>
<font color="#888888"><br>
--<br>
DSS5-RIPE DSS-RIPN mailto:<a href="mailto:dsh@wizard.volgograd.ru">dsh@wizard.volgograd.ru</a> <a href="mailto:xmpp%3Adsh@vlink.ru">xmpp:dsh@vlink.ru</a><br>
<a href="http://wizard.volgograd.ru/" target="_blank">http://wizard.volgograd.ru/</a> 2:550/5068@fidonet 2:550/5069@fidonet<br>
<br>
</font></blockquote></div><br></div>