Hi everyone,
I have a generic location that servers many others via rewrite/proxy_pass. The generic location calls expires by including a file which disables caching. I have new location with its own expiration logic that needs to bypass this. What is the best way to do this?
# Generic service.
location = /generic.js {
fastcgi_pass 'unix:/tmp/generic.socket';
include fastcgi.conf;
# only does: expires -1s;
include expires.conf;
}
location = /new.js {
set $new_upstream https://new.lskjdflsj.com/;
rewrite ^/new.js /generic.js?type=new;
proxy_pass $new_upstream;
}
I've read that if statements are undesirable in location although that seems to work. I've also tried setting an expires variable via a map which also works. But doesn't this execute for every request?
Zach