416 HTTP Response Issue

anish10dec nginx-forum at forum.nginx.org
Fri Jun 11 12:14:22 UTC 2021

Hi Team,

Though we have proxy cache valid defined to cache only respective response
code , nginx caching 416 response.

proxy_cache_valid  200 206  10d;
proxy_cache_key    $uri$http_range;

416 is returned from upstream server and its getting cached on Ngnix.

Even with default settings by not specifying http response behavior is
proxy_cache_valid  10d;

Sample response cached on CDN for 416 Response

HTTP/1.1 416 Requested Range Not Satisfiable^M
Server: nginx^M
Date: Tue, 01 Jun 2021 15:10:06 GMT^M
Content-Type: text/html^M
Content-Length: 190^M
Connection: close^M
Expires: Thu, 01 Jul 2021 14:10:43 GMT^M
Cache-Control: max-age=2592000^M
Access-Control-Allow-Origin: *^M
Access-Control-Allow-Methods: GET, POST, OPTIONS^M
Content-Range: bytes */4194304^M

Posted at Nginx Forum: https://forum.nginx.org/read.php?2,291835,291835#msg-291835

More information about the nginx mailing list