S
S
slavik2015-01-06 22:06:29
Nginx
slavik, 2015-01-06 22:06:29

Why doesn't Nginx pass the Last-Modified header to the named location?

I encountered a strange thing in Nginx: a simple location returns last-modified for files, and if processing goes to a named location, the header is not transmitted, tell me what could be the problem?

location / {
try_files $uri @cache;
}
location /working/.*\.jpg { # здесь есть last-modified из папки cache
try_files $uri /cache/$uri @fallback1; #@fallback1 - php-файл 1
}
location @cache { # здесь нет last-modified из папки cache2
...
try_files /cache2/$uri @fallback2; #@fallback2 - php-файл 2
}

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
slavik, 2015-01-08
@slavik

I didn’t quite understand what proxying has to do with it - statics in both cases is given by nginx, the only difference is that in one case (successful) graphics are given, etc. directly in a separate location, and in another (unsuccessful) - cached html-files are given in a named location.
After additional checks it turned out that headers are not sent for html-files, if you rename it, for example, to css - last-modified is sent
As a result, this is what was decided - ssi off; Because with ssi on no last-modified headers are sent, and ssi on is active for .html and so on. files, not for real static. In the end, I turned it off and it worked.

V
Voron4ik, 2015-01-06
@Voron4ik

nginx.org/ru/docs/http/ngx_http_proxy_module.html

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question