proxy_store skip not 200
mdounin at mdounin.ru
Fri Nov 27 13:54:57 UTC 2015
On Thu, Nov 26, 2015 at 09:03:19PM -0500, vps4 wrote:
> i setup proxy_store works fine, but has some problem
> when the backend response 404 or other result, proxy_store still save them
> for example:
> backend 1.jpg response 404 and html result, proxy_store will store it in
> how can i skip that results not 200 and verify by mime etc...
The proxy_store mechanism only stores responses with status code
200. If you see it storing 404s - responses you see are likely
returned with incorrect status code, that is, they are 200 in
fact. An obvious way way to fix this is to fix the backend to
properly return status code.
Additional response verification before it's store isn't available
with proxy_store. Some verification can be done when using
proxy_cache, using the proxy_no_cache directive
(http://nginx.org/r/proxy_no_cache) and appropriate mapping of
upstream response headers.
More information about the nginx