Why is Nginx ignoring the access_log directive when post_action is specified?

Posted by Chris on Server Fault See other posts from Server Fault or by Chris
Published on 2010-05-31T16:00:48Z Indexed on 2010/05/31 16:03 UTC
Read the original article Hit count: 277

Filed under:

Hi,

in the location below nginx writes a custom download log. Everything works fine except when there is a post_action directive.

I seems that nginx skips the access_log directive.

Here is the config:

location /download_intern/ {
    internal;

    if ($uri ~* ^/download_intern/([0-9]+)/) {
        set $transferID $1;
        set $server $arg_ip;
        set $url $arg_url;
        proxy_pass http://$server:80/$url;
        break;
    }


    log_format download '$remote_addr [$time_local]
$upstream_cache_status   "$scheme://$host$request_uri" $status
[$transferID] $body_bytes_sent';

    access_log /opt/nginx/logs/server.download_log download;


    # without this line the download log file is being written
    post_action /done;
}


location /done {
    internal;
    # log the transfer on the main server
    proxy_pass http://xxx.xxx.xxx.xxx:80/download_end/?tid=$transferID;
}

© Server Fault or respective owner

Related posts about nginx