Hello,
My use case is simple:
1) Serve static files coming from an upstream (using proxy_pass)
2) If the upstream returns a non-200/304 response - ALWAYS serve the file from cache, even if its expired/stale.
For the most part, 'proxy_cache_use_stale' does the trick.
However - it doesn't cover cases such as 401, 402, etc. (the full list it does support according to the docs: error | timeout | invalid_header | updating | http_500 | http_502 | http_503 | http_504 | http_403 | http_404 | http_429)
Is there a way I can achieve this? how can I force the file being served cache for the cases not covered by the 'proxy_cache_use_stale' directive? (even if it requires using lua)
My use case is simple:
1) Serve static files coming from an upstream (using proxy_pass)
2) If the upstream returns a non-200/304 response - ALWAYS serve the file from cache, even if its expired/stale.
For the most part, 'proxy_cache_use_stale' does the trick.
However - it doesn't cover cases such as 401, 402, etc. (the full list it does support according to the docs: error | timeout | invalid_header | updating | http_500 | http_502 | http_503 | http_504 | http_403 | http_404 | http_429)
Is there a way I can achieve this? how can I force the file being served cache for the cases not covered by the 'proxy_cache_use_stale' directive? (even if it requires using lua)