nginx expires
directive sets 2 headers, Expires
and Cache-Control
:
Config:
expires 1d;
Headers:
Expires: Tue, 24 Nov 2020 12:51:31 GMT
Cache-Control: max-age=86400
I would like to keep Expires
header but also set Cache-Control
to public, max-age=86400, immutable
. But that produces double Cache-Control
headers:
Config:
expires 1d;
add_header Cache-Control "public, max-age=86400, immutable"
Headers:
Expires: Tue, 24 Nov 2020 12:57:53 GMT
Cache-Control: max-age=86400
Cache-Control: public, max-age=86400, immutable
I can not just use add_header Expires ...
, because it requires exact time in future, not just number of seconds.
I tried using more_set_headers
from ngx_headers_more module, but Cache-Control
header set by expires
directive is still there.
Is there any way to combine correct Expires
header with Cache-Control
set to immutable
?