Quantcast
Channel: Nginx Forum - Nginx Mailing List - Russian
Viewing all articles
Browse latest Browse all 3102

Re: fastcgi cache valid для разных location'ов (5 replies)

$
0
0
On Mar 2, 2013, at 2:45 , Namaste wrote:

> Привет!
>
> Есть примерно такой вот конфиг:
>
> 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;
> }
>
> Хотелось бы сделать чтоб если срабатывал aaa location, то выдача
> хэшировалась скажем 5 минут, location bbb - 10 минут. Остальное час.
> Как такое сделать?

location /aaa/ {
location ~ ^/aaa/(<?PAGE>[0-9]+)\.html$ {
fastcgi_pass 127.0.0.1:9000;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root/test1.php;
fastcgi_param QUERY_STRING p1=$page;
fastcgi_cache mycache;
fastcgi_cache_key $scheme$host$request_uri$request_method;
fastcgi_cache_valid 200 301 302 5m;
}
}

и так далее.


--
Igor Sysoev
http://nginx.com/support.html

_______________________________________________
nginx-ru mailing list
nginx-ru@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-ru

Viewing all articles
Browse latest Browse all 3102

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>