post_action docs

Igor Sysoev is at rambler-co.ru
Mon Feb 25 22:00:33 MSK 2008


On Mon, Feb 25, 2008 at 03:26:18PM +1100, Rob Mueller wrote:

> To reply to myself...
> 
> >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...;
> 
> I found this previous post:
> 
> http://article.gmane.org/gmane.comp.web.nginx.english/1305
> 
> Which seems to fix issue 2 nicely. Now if only I could fix the first issue.

The attached patch enables named location in post_action:

    post_action  @done;

    location @done {
        ...


-- 
Igor Sysoev
http://sysoev.ru/en/
-------------- next part --------------
Index: src/http/ngx_http_request.c
===================================================================
--- src/http/ngx_http_request.c	(revision 1213)
+++ src/http/ngx_http_request.c	(working copy)
@@ -2448,8 +2448,13 @@
 
     r->read_event_handler = ngx_http_block_reading;
 
-    ngx_http_internal_redirect(r, &clcf->post_action, NULL);
+    if (clcf->post_action.data[0] == '/') {
+        ngx_http_internal_redirect(r, &clcf->post_action, NULL);
 
+    } else {
+        ngx_http_named_location(r, &clcf->post_action);
+    }
+
     return NGX_OK;
 }
 


More information about the nginx mailing list