use proxy_store,<br>if the file update on backend, then the nginx proxy can not auto update file<br><br><div><span class="gmail_quote">2007/7/18, Igor Sysoev <<a href="mailto:is@rambler-co.ru">is@rambler-co.ru</a>>:</span>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">On Wed, Jul 18, 2007 at 12:03:17AM +0200, Janko Hauser wrote:<br><br>><br>> Am 17.07.2007
um 15:53 schrieb Janko Hauser:<br>><br>> >Am 17.07.2007 um 15:16 schrieb Igor Sysoev:<br>> ><br>> >>On Tue, Jul 17, 2007 at 02:43:17PM +0200, Janko Hauser wrote:<br>> >><br>> >>>Am
17.07.2007 um 12:44 schrieb Igor Sysoev:<br>> >>><br>> >>>>proxy_store is not cache, it's rather mirror on demand:<br>> >>>><br>> >>>>location /images/ {<br>> >>>> root /data/www;
<br>> >>>> error_page 404 = /fetch$uri;<br>> >>>>}<br>> >>>><br>> >>>>location /fetch {<br>> >>>> internal;<br>> >>>>
<br>> >>>> proxy_pass <a href="http://backend">http://backend</a>;<br>> >>>> proxy_store on;<br>> >>>> proxy_store_access user:rw group:rw all:r;<br>
> >>>> proxy_temp_path /data/temp;<br>> >>>><br>> >>>> alias /data/www;<br>> >>>>}<br>> >>>><br>> >>>>if file is not found, then it will be fetched from backend and
<br>> >>>>stored<br>> >>>>in 'root/alias' or in path specified explicitly:<br>> >>>><br>> >>>>proxy_store /data/www$original_uri;<br>> >>><br>
> >>>Ah, that makes things clearer. Is it possible to steer this from the<br>> >>>backend by setting headers in the response or some other means? But<br>> >>>this alone will help a lot, thanks.
<br>> >><br>> >>proxy_store /data/www$http_upstream_some_header;<br>> ><br>> >Ah, great, first I thought, this would set only the location, but<br>> >if the backend sets a "wrong" path, the backend can actually
<br>> >decide, if its content should be stored. The flexibility of nginx<br>> >is amazing.<br>><br>> Hm, thinking about this some more, the setting of a wrong path would<br>> nevertheless mean, that something is written everytime the page is
<br>> called. It would be better to have some form of conditional,<br>> preferable by the existence of a specific header, which can decide if<br>> proxy_store directive is active, and the return value from the<br>
> backend is stored.<br><br>proxy_set_header X-Store yes;<br><br><br>--<br>Igor Sysoev<br><a href="http://sysoev.ru/en/">http://sysoev.ru/en/</a><br><br></blockquote></div><br><br clear="all"><br>-- <br>Best Regards
<br>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br>焦胜强<br>上海我要网络发展有限公司 运维部 <br>上海浦东新区峨山路91弄200号新鹏大厦2楼 邮编 200127 <br>Tel: +86(021)58815151-5160 <br>Fax: +86(021)50904695<br>QQ: 34849502<br>MSN: <a href="mailto:jsq_yy@hotmail.com">
jsq_yy@hotmail.com</a> <br>Email: <a href="mailto:jiaosq@mail.51.com">jiaosq@mail.51.com</a> <br>Visit us: <a href="http://www.51.com">http://www.51.com</a>