5 messages in ru.sysoev.nginxRe: piping access log
FromSent OnAttachments
RapseyJun 8, 2007 8:53 am 
Igor SysoevJun 8, 2007 9:30 am 
RapseyJun 8, 2007 9:39 am 
RapseyJun 8, 2007 11:09 am 
Igor SysoevJun 8, 2007 11:18 am 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:Re: piping access logActions...
From:Igor Sysoev (is-G@public.gmane.org)
Date:Jun 8, 2007 11:18:07 am
List:ru.sysoev.nginx

On Fri, Jun 08, 2007 at 08:09:59PM +0200, Rapsey wrote:

A named pipe works great. But post_action does not seem to do anything.

location /sportna/ { internal; root /var/www/htdocs/sportna; post_action /done; }

location = /done { internal; fastcgi_pass 127.0.0.1:10000; fastcgi_param URI $request_uri; }

The fastcgi application does not receive anything, nothing is in error log and nothing about /done gets sent do access log.

You need to add other fastcgi_param's, say

fastcgi_param SCRIPT_FILENAME /some/script/done;

"fastcgi_param URI $request_uri" is example for indication original URI only.

post_action is not logged in access_log.

Ok thanks. This will work just as well.

On 6/8/07, Igor Sysoev <is-G@public.gmane.org> wrote:

On Fri, Jun 08, 2007 at 05:54:22PM +0200, Rapsey wrote:

Are there any plans for adding support for logging to a pipe anytime soon? I presume this: http://blog.pjkh.com/articles/2007/03/15/nginx-and-cronolog is the only way it can be achieved right now and it's pretty ugly.

My application is connected to nginx through fcgi, it uses X-accel-redirect to send a (large) file to a user, and it needs to know exactly when a user has finished downloading.

No, I do not plan to add piped logs. However, you can use named pipe (FIFO).

Also you can use the post_action to track downloading:

location /xar/ { internal;

root ...; post_action /done; }

location = /done { internal;

fastcgi_pass ... fastcgi_param URI $request_uri; .... }