Forum: NGINX http header doesn't pass throw nginx to php-fpm

2974d09ac2541e892966b762aad84943?d=identicon&s=25 Kurk_SS (Guest)
on 2014-02-25 15:33
(Received via mailing list)
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:
http://forum.nginx.org/read.php?2,247932,247932#msg-247932
A8108a0961c6087c43cda32c8616dcba?d=identicon&s=25 Maxim Dounin (Guest)
on 2014-02-25 17:26
(Received via mailing list)
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 Dounin
http://nginx.org/
Please log in before posting. Registration is free and takes only a minute.
Existing account

NEW: Do you have a Google/GoogleMail, Yahoo or Facebook account? No registration required!
Log in with Google account | Log in with Yahoo account | Log in with Facebook account
No account? Register here.