post_action docs

Rob Mueller robm at
Mon Feb 25 04:16:01 MSK 2008

I'm trying to use post_action to track some download information, but I'm 
having a few issues. I've done some searching, but the documentation for 
this feature is almost non-existant from what I can see. Am I missing 

Anyway, my two main questions.

1. I have a server config that proxies all requests and all directories for 
a number domains directly to a backend server. Because it's all directories, 
I can't reserve one for the post_action handler like the examples I've 
normally seen. (e.g. the example here:

So I've tried this:

  server {
    listen a.b.c.d:80;

    location / {
      rewrite (.*) /http/$host$1 break;
      proxy_pass http://backend/;

  server {
    location = /done {
      fastcgi_pass ... etc ...

But that didn't seem to work. Is there any way to get the post_action to 
submit to a completely separate server { } block?

2. I want to pass a header returned by the upstream server to the 
post_action handler for logging purposes, but I'm not sure how to do that. I 
must be missing something obvious here.

      fastcgi_param  PARAM_EXTRA_1   ...some upstream header...;



More information about the nginx mailing list