Re: proxy_cache_valid depending on $host

2021-01-26 Thread Phil Endecott
Maxim Dounin wrote: On Mon, Jan 25, 2021 at 04:26:49PM +, Phil Endecott wrote: Is there some work-around to have different cache validity times for different hosts, in a caching proxy? Using different server{} blocks with different server_name's is the way to go, see http://nginx.org/r/se

Re: proxy_cache_valid depending on $host

2021-01-25 Thread Maxim Dounin
Hello! On Mon, Jan 25, 2021 at 04:26:49PM +, Phil Endecott wrote: > Dear Experts, > > I wanted to write this: > > proxy_cache_valid 200 5m; > if ($host ~ foo) { >proxy_cache_valid 200 30d; > } > > but proxy_cache_valid is not allowed in "if" blocks. > Is there some work-around to have

proxy_cache_valid depending on $host

2021-01-25 Thread Phil Endecott
Dear Experts, I wanted to write this: proxy_cache_valid 200 5m; if ($host ~ foo) { proxy_cache_valid 200 30d; } but proxy_cache_valid is not allowed in "if" blocks. Is there some work-around to have different cache validity times for different hosts, in a caching proxy? Thanks, Phil. __