Hello!
On Thu, Feb 11, 2016 at 3:33 PM, RJoshi wrote:
> Is it possible to set a different value for proxy_cache_valid directive
> using Lua module? I have a requirement to set different expire time per
> service.
> I tried below in Nginx.conf but gives error.
>
> set proxy_cache_value 1m;
>
> proxy_cache_valid $proxy_cache_value;
>
IIRC, the proxy_cache_valid directive does not support nginx
variables. You can try patching the NGINX core to add the support (and
possibly proposing the patch to the nginx-devel mailing list too), or
wait for the upcoming cache_filter_by_lua* directives which support
custom Lua code to control the NGINX http cache on a per-request
basis.
Best regards,
-agentzh