Nginx: conditional "expires" directive

António P. P. Almeida appa at perusio.net
Tue Aug 16 13:18:03 UTC 2011


On 16 Ago 2011 13h25 WEST, nginx-forum at nginx.us wrote:

> It seems that expires directive does not support varaibles.

Then try this:

location / {

  if ($arg_no_caching) {
     return 302 /no-caching;
  }

  expires 30d;
}

location /no-caching {
   expires epoch;
}

--- appa



More information about the nginx mailing list