I need to active/inactive 'updating' params of proxy_cache_use_stale directive based on a cookie value in Nginx.
This is the normal config
proxy_cache_use_stale error updating timeout http_500;
I change the config to the following:
if ($cookie_req = 1){
proxy_cache_use_stale error updating timeout http_500;
}
if ($cookie_req = 2){
proxy_cache_use_stale error timeout http_500;
}
When I validate the new config through nginx -t the following error raised.
nginx: [emerg] "proxy_cache_use_stale" directive is not allowed ...
How can I do that?
1条答案
按热度按时间v09wglhw1#
I used access_by_lua_block