location ~* ^/media/.+\.(mp3|wma|ogg|ape|flac)$ {
set $orig_uri $uri;
set $orig_args $args;
set $orig_ip $remote_addr;
set $orig_query $query_string;
set $orig_xforw $http_x_forwarded_for;
post_action /counter.php?bs=$body_bytes_sent;
}
location = /counter.php {
internal;
fastcgi_param SCRIPT_FILENAME/srv/www/mp3/public_html$fastcgi_script_name;
fastcgi_param QUERY_STRING $query_string;
fastcgi_param REQUEST_METHOD $request_method;
fastcgi_param CONTENT_TYPE $content_type;
fastcgi_param CONTENT_LENGTH $content_length;
fastcgi_param HTTP_RANGE $http_range;
fastcgi_param REMOTE_ADDR $remote_addr;
fastcgi_param URI $request_uri;
fastcgi_param BYTES_SENT $body_bytes_sent;
# include /usr/local/nginx/conf/fastcgi.conf;
fastcgi_pass 127.0.0.1:8888;
fastcgi_index index.php;
}