Http header doesn't pass throw nginx to php-fpm

I use

http{
underscores_in_headers on;
ignore_invalid_headers off;

and all works fine. php code can see HTTP_RANGE in $_SERVER array.

but when I use fastcgi cache.

location / {
if ($request_method != GET) { break;} #bad request
try_files @echofile @echofile; #request_uri is a target for download
}

location @echofile {
include fastcgi_params;
#fastcgi_split_path_info ^(.+.php)(/.+)$;
fastcgi_param QUERY_STRING controller=files&target=$request_uri;
fastcgi_param SCRIPT_FILENAME $root_path/index.php;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;

fastcgi_ignore_headers “Expires” “Cache-Control” “Set-Cookie”;

fastcgi_temp_path /tmp/dfg12d1 2;
fastcgi_cache dfg12d1;
fastcgi_cache_key “$request_uri”;
fastcgi_hide_header “Set-Cookie”;
fastcgi_cache_min_uses 1;
#fastcgi_cache_valid 1d;

using X-Accel-Expires header in php

}

It not works now.

why?

Posted at Nginx Forum:

Hello!

On Tue, Feb 25, 2014 at 09:32:54AM -0500, Kurk_SS wrote:

I use

http{
underscores_in_headers on;
ignore_invalid_headers off;

and all works fine. php code can see HTTP_RANGE in $_SERVER array.

but when I use fastcgi cache.

[…]

It not works now.

why?

Cache needs full responses, hence it strips Range header
from requests to backends.


Maxim D.
http://nginx.org/