Welcome! Log In Create A New Profile

Advanced

Redirect depending on $upstream_cache_status

Posted by nixon1974 
Redirect depending on $upstream_cache_status
January 19, 2015 05:36AM
Is there a way to jump to different locations depending on $upstream_cache_status?
I tried something like

set $skip_cache 0;
if ($upstream_cache_status = HIT) {
set $skip_cache 0;
}
if ($upstream_cache_status != HIT) {
set $skip_cache 1;
}

But $upstream_cache_status returns empty value.

content_by_lua also returns empty value.

Thanks in advance
Re: Redirect depending on $upstream_cache_status
January 19, 2015 06:04AM
See https://github.com/openresty/lua-nginx-module/issues/125

---
nginx for Windows http://nginx-win.ecsds.eu/
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 287
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready