Strange problem with expires?
Grzegorz Kulewski
gk at leniwiec.biz
Tue Mar 1 20:57:25 UTC 2022
W dniu 01.03.2022 o 21:49, Grzegorz Kulewski pisze:
> W dniu 01.03.2022 o 21:43, David Hu pisze:
>> On 1 March 2022 20:40:48 UTC, Grzegorz Kulewski <gk at leniwiec.biz> wrote:
>>> Hello,
>>>
>>> I am using nginx 1.21.0 to serve static files for one domain and when I have:
>>>
>>> location = / {
>>> expires epoch;
>>> }
>>>
>>> expire headers are not added for / but when I remove '=' they are.
>>>
>>> Is this some bug or just me doing something stupid?
>>>
>>> Can anybody reproduce it too?
>>>
>>
>> This is expected behaviour
>
> But... why?
>
> Is it documented somewhere? I don't see it here: http://nginx.org/en/docs/http/ngx_http_headers_module.html#expires and it seems quite normal to me to have different cache settings for main page than for assets.
Ok, it works when I changed it to location = /index.html. I forgot that index module is doing an internal rewrite and that rules are re-checked with /index.html. Thank you.
Maybe somebody should add a warning about that to location docs.
--
Grzegorz Kulewski
More information about the nginx
mailing list