Proxy Cache-Setting

Francis Daly francis at daoine.org
Sat Dec 6 23:58:32 UTC 2014


On Sat, Dec 06, 2014 at 06:49:44PM -0500, MasterTH wrote:

Hi there,

> What we'd like to cache is something like:
> http://api.domain.tld/calculate/%CUSTOMER_ID%/ (and everything what comes
> behind that url)
> 
> And this calls we doesn't like to cache:
> http://api.domain.tld/calculate/?calc=23+45
> http://api.domain.tld/calculate?calc=23*45

It looks like a fairly straightforward three-location system, since you
have three url types that you want handled differently.

  location = /calculate {
    proxy_pass...;
  }
  location = /calculate/ {
    proxy_pass...;
  }
  location /calculate/ {
    proxy_pass...;
    proxy_cache...;
  }

I guess that if you already proxy_cache everything, set it to "off"
in the two exact locations.

	f
-- 
Francis Daly        francis at daoine.org



More information about the nginx mailing list