custom access_log per location /

bit_kevin nginx-forum at nginx.us
Tue Nov 17 08:03:05 MSK 2009


I have the same problem.

------------------------------------------------------------------------

    log_format  access  '$remote_addr\t-\t$remote_user\t[$time_local]\t"$request"\t'
        '$status\t$body_bytes_sent\t"$http_referer"\t'
        '"$http_user_agent"\t$http_x_forwarded_for';

    access_log  /d1/logs/access.log  access;

#limit_conn   crawler  20;    

    location ~ .*\.(php|php5)?$
    {
#fastcgi_pass  unix:/tmp/php-cgi.sock;
        fastcgi_pass  127.0.0.1:9000;
        fastcgi_index index.php;
        include fcgi.conf;
    }

    location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
    {
        expires      30d;
    }

    location ~ .*\.(js|css)?$
    {
        expires      1h; 
    }

    location /noresult_dispatch/ {
        access_log  /d1/logs/noresult_dispatch-access.log  access;
    }


-------------------------
"/d1/logs/noresult_dispatch-access.log  " filesize is 0.

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






More information about the nginx mailing list