Hello, everyone!
I have a rule in place that will proxy and cache a bunch of file extensions:
######
location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
proxy_pass http://{backend_IPs_pool};
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP $remote_addr;
proxy_cache STATIC;
proxy_cache_valid 200 1d;
proxy_cache_use_stale error timeout invalid_header updating
http_500 http_502 http_503 http_504;
}
######
I need the proxy server to bypass the cache in case the file size is larger than 2MB. I believe the best way to achieve that would be by forwarding the request to the upstream through a 301 redirect so that I can save the extremely expensive bandwidth on the proxy server.
Any ideas?
Thank you very much!
I have a rule in place that will proxy and cache a bunch of file extensions:
######
location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
proxy_pass http://{backend_IPs_pool};
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP $remote_addr;
proxy_cache STATIC;
proxy_cache_valid 200 1d;
proxy_cache_use_stale error timeout invalid_header updating
http_500 http_502 http_503 http_504;
}
######
I need the proxy server to bypass the cache in case the file size is larger than 2MB. I believe the best way to achieve that would be by forwarding the request to the upstream through a 301 redirect so that I can save the extremely expensive bandwidth on the proxy server.
Any ideas?
Thank you very much!