Quantcast
Channel: Nginx Forum
Viewing all articles
Browse latest Browse all 53287

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

$
0
0
Здравствуйте, Уважаемый(-ая, -ое) Namaste!

N> Есть примерно такой вот конфиг:

N> location /aaa/ {
N> rewrite ^/aaa/([0-9]+)\.html$ /test.php?p1=$1 last;
N> }

N> location /bbb/ {
N> rewrite ^/bbb/([0-9]+)\.html$ /test2.php?p1=$1 last;
N> }

N> location ~ \.php$ {
N> fastcgi_pass 127.0.0.1:9000;
N> fastcgi_index index.php;
N> fastcgi_param SCRIPT_FILENAME
N> $document_root$fastcgi_script_name;
N> include fastcgi_params;
N> fastcgi_cache mycache;
N> fastcgi_cache_key $scheme$host$request_uri$request_method;
N> fastcgi_cache_valid 200 301 302 60m;
N> }

N> Хотелось бы сделать чтоб если срабатывал aaa location, то выдача
N> хэшировалась скажем 5 минут, location bbb - 10 минут. Остальное час.
N> Как такое сделать?

Попробуйте прописать fastcgi_cache_valid там, где он вам нужен.
По идее, параметры наследуются. Без идеи проще будет проверить.
Если не заработает - будем искать другие способы.


--
С уважением

Andrey Repin (hell-for-yahoo@umail.ru) суббота, 02.03.2013, <04:33>
_______________________________________________
nginx-ru mailing list
nginx-ru@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-ru

Viewing all articles
Browse latest Browse all 53287

Trending Articles



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