<div>Доброго времени суток.</div><div><br></div>Пытаюсь выставить Expires до полуночи:<div><br></div><div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace">location /test.php {</font></div><div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace"><div>

        fastcgi_pass <a href="http://127.0.0.1:1234">127.0.0.1:1234</a>;</div><div><br></div><div><div>        include /etc/nginx/fastcgi_params;</div></div><div><br></div><div>        fastcgi_param SCRIPT_FILENAME $www_root$fastcgi_script_name;</div>

<div>        fastcgi_param PATH_INFO $fastcgi_script_name;</div><div>        fastcgi_ignore_headers Expires; # для наглядности, хотя бэкенд и так не отдает этот заголовок</div><div>        ssi on;</div><div><br></div></font></div>

<div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace">        expires @24h;</font></div><div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace">        add_header Cache-Control public;</font></div>

<div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace">}</font></div><div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace"><br></font></div><div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace">И получаю следующий ответ:</font></div>

<div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace"><br></font></div><div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace"><span class="Apple-style-span" style="font-family: &#39;Lucida Grande&#39;, sans-serif; font-size: 11px; -webkit-text-size-adjust: none; "><ol class="children expanded" style="-webkit-box-sizing: border-box; position: relative; padding-top: 2px !important; padding-right: 6px !important; padding-bottom: 2px !important; padding-left: 6px !important; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; color: black; cursor: default; min-width: 100%; list-style-type: none; -webkit-padding-start: 12px; display: block; ">

<li title="" style="-webkit-box-sizing: border-box; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 14px; margin-top: 1px; margin-bottom: 1px; word-wrap: break-word; text-indent: -1px; white-space: nowrap; ">

<div class="header-name" style="-webkit-box-sizing: border-box; color: rgb(84, 84, 84); display: inline-block; margin-right: 0.5em; font-weight: bold; vertical-align: top; white-space: pre-wrap; ">Cache-Control:</div><div class="header-value source-code" style="-webkit-box-sizing: border-box; font-family: &#39;dejavu sans mono&#39;, monospace; font-size: 11px; white-space: pre-wrap; display: inline; margin-right: 100px; word-break: break-all; margin-top: 1px; ">

max-age=86400, public</div></li><li title="" style="-webkit-box-sizing: border-box; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 14px; margin-top: 1px; margin-bottom: 1px; word-wrap: break-word; text-indent: -1px; white-space: nowrap; ">

<div class="header-name" style="-webkit-box-sizing: border-box; color: rgb(84, 84, 84); display: inline-block; margin-right: 0.5em; font-weight: bold; vertical-align: top; white-space: pre-wrap; ">Connection:</div><div class="header-value source-code" style="-webkit-box-sizing: border-box; font-family: &#39;dejavu sans mono&#39;, monospace; font-size: 11px; white-space: pre-wrap; display: inline; margin-right: 100px; word-break: break-all; margin-top: 1px; ">

keep-alive</div></li><li title="" style="-webkit-box-sizing: border-box; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 14px; margin-top: 1px; margin-bottom: 1px; word-wrap: break-word; text-indent: -1px; white-space: nowrap; ">

<div class="header-name" style="-webkit-box-sizing: border-box; color: rgb(84, 84, 84); display: inline-block; margin-right: 0.5em; font-weight: bold; vertical-align: top; white-space: pre-wrap; ">Content-Encoding:</div>
<div class="header-value source-code" style="-webkit-box-sizing: border-box; font-family: &#39;dejavu sans mono&#39;, monospace; font-size: 11px; white-space: pre-wrap; display: inline; margin-right: 100px; word-break: break-all; margin-top: 1px; ">

gzip</div></li><li title="" style="-webkit-box-sizing: border-box; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 14px; margin-top: 1px; margin-bottom: 1px; word-wrap: break-word; text-indent: -1px; white-space: nowrap; ">

<div class="header-name" style="-webkit-box-sizing: border-box; color: rgb(84, 84, 84); display: inline-block; margin-right: 0.5em; font-weight: bold; vertical-align: top; white-space: pre-wrap; ">Content-Type:</div><div class="header-value source-code" style="-webkit-box-sizing: border-box; font-family: &#39;dejavu sans mono&#39;, monospace; font-size: 11px; white-space: pre-wrap; display: inline; margin-right: 100px; word-break: break-all; margin-top: 1px; ">

text/html; charset=utf-8</div></li><li title="" style="-webkit-box-sizing: border-box; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 14px; margin-top: 1px; margin-bottom: 1px; word-wrap: break-word; text-indent: -1px; white-space: nowrap; ">

<div class="header-name" style="-webkit-box-sizing: border-box; color: rgb(84, 84, 84); display: inline-block; margin-right: 0.5em; font-weight: bold; vertical-align: top; white-space: pre-wrap; ">Date:</div><div class="header-value source-code" style="-webkit-box-sizing: border-box; font-family: &#39;dejavu sans mono&#39;, monospace; font-size: 11px; white-space: pre-wrap; display: inline; margin-right: 100px; word-break: break-all; margin-top: 1px; ">

Thu, 16 Sep 2010 14:57:46 GMT</div></li><li title="" style="-webkit-box-sizing: border-box; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 14px; margin-top: 1px; margin-bottom: 1px; word-wrap: break-word; text-indent: -1px; white-space: nowrap; ">

<div class="header-name" style="-webkit-box-sizing: border-box; color: rgb(84, 84, 84); display: inline-block; margin-right: 0.5em; font-weight: bold; vertical-align: top; white-space: pre-wrap; ">Expires:</div><div class="header-value source-code" style="-webkit-box-sizing: border-box; font-family: &#39;dejavu sans mono&#39;, monospace; font-size: 11px; white-space: pre-wrap; display: inline; margin-right: 100px; word-break: break-all; margin-top: 1px; ">

Fri, 17 Sep 2010 14:57:46 GMT</div></li><li title="" style="-webkit-box-sizing: border-box; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 14px; margin-top: 1px; margin-bottom: 1px; word-wrap: break-word; text-indent: -1px; white-space: nowrap; ">

<div class="header-name" style="-webkit-box-sizing: border-box; color: rgb(84, 84, 84); display: inline-block; margin-right: 0.5em; font-weight: bold; vertical-align: top; white-space: pre-wrap; ">Keep-Alive:</div><div class="header-value source-code" style="-webkit-box-sizing: border-box; font-family: &#39;dejavu sans mono&#39;, monospace; font-size: 11px; white-space: pre-wrap; display: inline; margin-right: 100px; word-break: break-all; margin-top: 1px; ">

timeout=20</div></li><li title="" style="-webkit-box-sizing: border-box; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 14px; margin-top: 1px; margin-bottom: 1px; word-wrap: break-word; text-indent: -1px; white-space: nowrap; ">

<div class="header-name" style="-webkit-box-sizing: border-box; color: rgb(84, 84, 84); display: inline-block; margin-right: 0.5em; font-weight: bold; vertical-align: top; white-space: pre-wrap; ">Server:</div><div class="header-value source-code" style="-webkit-box-sizing: border-box; font-family: &#39;dejavu sans mono&#39;, monospace; font-size: 11px; white-space: pre-wrap; display: inline; margin-right: 100px; word-break: break-all; margin-top: 1px; ">

nginx/0.7.62</div></li><li title="" style="-webkit-box-sizing: border-box; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 14px; margin-top: 1px; margin-bottom: 1px; word-wrap: break-word; text-indent: -1px; white-space: nowrap; ">

<div class="header-name" style="-webkit-box-sizing: border-box; color: rgb(84, 84, 84); display: inline-block; margin-right: 0.5em; font-weight: bold; vertical-align: top; white-space: pre-wrap; ">Transfer-Encoding:</div>

<div class="header-value source-code" style="-webkit-box-sizing: border-box; font-family: &#39;dejavu sans mono&#39;, monospace; font-size: 11px; white-space: pre-wrap; display: inline; margin-right: 100px; word-break: break-all; margin-top: 1px; ">

chunked</div></li><li title="" style="-webkit-box-sizing: border-box; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 14px; margin-top: 1px; margin-bottom: 1px; word-wrap: break-word; text-indent: -1px; white-space: nowrap; ">

<div class="header-name" style="-webkit-box-sizing: border-box; color: rgb(84, 84, 84); display: inline-block; margin-right: 0.5em; font-weight: bold; vertical-align: top; white-space: pre-wrap; ">X-Powered-By:</div><div class="header-value source-code" style="-webkit-box-sizing: border-box; font-family: &#39;dejavu sans mono&#39;, monospace; font-size: 11px; white-space: pre-wrap; display: inline; margin-right: 100px; word-break: break-all; margin-top: 1px; ">

PHP/5.2.13-pl0-gentoo</div></li></ol></span></font></div><div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace"><br></font></div>Т.е. вместо того, что бы выставить Expires до полуночи, nginx выставил его на 24 часа, что, насколько я понимаю, не правильно.<br>

Я, конечно, понимаю, что правильнее здесь было бы выдавать эти заголовки бэкендом, но все же хотелось бы понять почему так происходит.<meta http-equiv="content-type" content="text/html; charset=utf-8"><meta http-equiv="content-type" content="text/html; charset=utf-8"><div>

<br></div><div><div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace">$ nginx -V</font></div><div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace">nginx version: nginx/0.7.62</font></div>

<div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace">configure arguments: --prefix=/usr --conf-path=/etc/nginx/nginx.conf --http-log-path=/var/log/nginx/access_log --error-log-path=/var/log/nginx/error_log --pid-path=/var/run/nginx.pid --http-client-body-temp-path=/var/tmp/nginx/client --http-proxy-temp-path=/var/tmp/nginx/proxy --http-fastcgi-temp-path=/var/tmp/nginx/fastcgi --with-md5-asm --with-md5=/usr/include --with-sha1-asm --with-sha1=/usr/include --with-http_addition_module --with-http_realip_module --with-http_ssl_module --with-http_perl_module --with-http_stub_status_module</font></div>

</div>