Welcome! Log In Create A New Profile

Advanced

Re: Strange problem with expires?

Grzegorz Kulewski
March 01, 2022 04:00PM
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@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
_______________________________________________
nginx mailing list -- nginx@nginx.org
To unsubscribe send an email to nginx-leave@nginx.org
Subject Author Posted

Strange problem with expires?

Grzegorz Kulewski March 01, 2022 03:46PM

Re: Strange problem with expires?

David Hu via nginx March 01, 2022 03:46PM

Re: Strange problem with expires?

Grzegorz Kulewski March 01, 2022 03:56PM

Re: Strange problem with expires?

Grzegorz Kulewski March 01, 2022 04:00PM

Re: Strange problem with expires?

Lucas Rolff March 01, 2022 03:54PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 328
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready