<html>
<head>
<meta content="text/html; charset=KOI8-R" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">Как минимум, в вашем случае определение
сроков кеширования надо делать внутри location, а зоны кеширования
внутри server:<br>
<pre wrap="">server {
fastcgi_cache mycache;
fastcgi_cache_key $scheme$host$request_uri$request_method;
location <i class="moz-txt-slash"><span class="moz-txt-tag">/</span>aaa<span class="moz-txt-tag">/</span></i> {
fastcgi_cache_valid 200 301 302 5m;
rewrite ^<i class="moz-txt-slash"><span class="moz-txt-tag">/</span>aaa<span class="moz-txt-tag">/</span></i>([0-9]+)\.html$ /test.php?p1=$1 last;
}
location <i class="moz-txt-slash"><span class="moz-txt-tag">/</span>bbb<span class="moz-txt-tag">/</span></i> {
fastcgi_cache_valid 200 301 302 10m;
rewrite ^<i class="moz-txt-slash"><span class="moz-txt-tag">/</span>bbb<span class="moz-txt-tag">/</span></i>([0-9]+)\.html$ /test2.php?p1=$1 last;
}
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
</pre>
<br>
<br>
02.03.13 12:58, Namaste пишет:<br>
</div>
<blockquote
cite="mid:085f7d7afb5abd35f08936aca9abe047.NginxMailingListRussian@forum.nginx.org"
type="cite">
<pre wrap="">В том то и дело, что так просто оно не работает.
например:
server {
fastcgi_cache_valid 200 301 302 10s;
location /aaa/ {
rewrite ^/aaa/([0-9]+)\.html$ /test.php?p1=$1 last;
}
location /bbb/ {
rewrite ^/bbb/([0-9]+)\.html$ /test2.php?p1=$1 last;
}
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
fastcgi_cache mycache;
fastcgi_cache_key $scheme$host$request_uri$request_method;
#fastcgi_cache_valid 200 301 302 60m;
}
}
Так кэш вообще не включается.
Posted at Nginx Forum: <a class="moz-txt-link-freetext" href="http://forum.nginx.org/read.php?21,236809,236814#msg-236814">http://forum.nginx.org/read.php?21,236809,236814#msg-236814</a>
_______________________________________________
nginx-ru mailing list
<a class="moz-txt-link-abbreviated" href="mailto:nginx-ru@nginx.org">nginx-ru@nginx.org</a>
<a class="moz-txt-link-freetext" href="http://mailman.nginx.org/mailman/listinfo/nginx-ru">http://mailman.nginx.org/mailman/listinfo/nginx-ru</a></pre>
</blockquote>
<pre class="moz-signature" cols="72">--
Pavel Mironov</pre>
</body>
</html>