Problem with fastcgi cache

firestorm nginx-forum at nginx.us
Sun Oct 30 03:55:22 UTC 2011


Hello, I´m working with Nginx v1.0.8.

I have the configuration for fastcgi cache:

server {
	listen 8080;

        //many other lines of configuration

       fastcgi_cache_path /var/www/cache levels=1:2 keys_zone=zera:10m
inactive=5m;
       fastcgi_temp_path /var/www/cache/tmp;

      server {
	listen 80;
	server_name localhost;

        //more configuration

        location ~ "^(.+\.php)(/.+)" {
        set $script $uri;
        set $path_info "";

        error_log  logs/debug.log  debug;

        set $script $1;
        set $path_info $2;

        #fastcgi_pass   127.0.0.1:9000;
        fastcgi_pass   unix:/var/run/php.sock;
        fastcgi_cache zera;
        fastcgi_cache_key $server_addr$request_uri;
	 fastcgi_cache_valid 200 302 1h;
	 fastcgi_cache_valid 301 1d;
	 fastcgi_cache_valid any 1m;
	 fastcgi_cache_min_uses 1;
	 fastcgi_cache_use_stale error timeout invalid_header http_500;
        fastcgi_index  index.php;

        include        fastcgi_params;

        fastcgi_param  SCRIPT_FILENAME  /var/www/myapp/web$script;
        fastcgi_param  SCRIPT_NAME      $script;
        fastcgi_param  PATH_INFO        $path_info;
    }

I can´t see the nginx creating files in /var/www/cache or
/var/www/cache/tmp.

The php process is actually doing the work.

Looking at the debug logs I can see:

2011/10/29 19:36:18 [debug] 32377#0: *1 post access phase: 10
2011/10/29 19:36:18 [debug] 32377#0: *1 http init upstream, client
timer: 0
2011/10/29 19:36:18 [debug] 32377#0: *1 epoll add event: fd:15 op:3
ev:80000005
2011/10/29 19:36:18 [debug] 32377#0: *1 http script var:
"10.128.50.101"
2011/10/29 19:36:18 [debug] 32377#0: *1 http script var:
"/administration.php/school"
2011/10/29 19:36:18 [debug] 32377#0: *1 http cache key:
"10.128.50.101/administration.php/school"
2011/10/29 19:36:18 [debug] 32377#0: *1 add cleanup: 092C6E3C
2011/10/29 19:36:18 [debug] 32377#0: *1 http file cache exists: -5 e:0
2011/10/29 19:36:18 [debug] 32377#0: *1 cache file:
"/var/www/cache/8/4f/2de84a2a49161ae7d7d4d8fba314e4f8"
2011/10/29 19:36:18 [debug] 32377#0: *1 add cleanup: 092C6E80
2011/10/29 19:36:18 [debug] 32377#0: *1 http upstream cache: -5
2011/10/29 19:36:18 [debug] 32377#0: *1 http script copy:
"QUERY_STRING"

I preciate any help with this issue.

Thanks in advance.

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,217538,217538#msg-217538



More information about the nginx mailing list