i tried to use like this
server {
set $cache_time 1d;
if ($request_uri = "/") {
set $cache_time 3d;
}
if ($request_uri ~ "^/other") {
set $cache_time 30d;
}
location / {
try_files $uri @fetch;
}
location @fetch {
proxy_cache_valid 200 301 302 $cache_time;
}
}
then i got error "invalid time value "$cache_time" in /etc/nginx/xxx.conf
how can i fix this?