post_action to a backend server

Maxim Dounin mdounin at mdounin.ru
Sun Jan 25 15:01:13 MSK 2009


Hello!

On Sat, Jan 24, 2009 at 07:19:10PM +0000, Paul Bowsher wrote:

> Hi,
> I am currently using nginx on frontend to proxy all requests to an apache
> backend. I want to use post_action to callback upon completion of a request.
> 
> The location I want to callback to is on the backend. Currently I have the
> following:
> 
>         location / {
>             proxy_pass http://test;
>             post_action /test_post.php;
>         }
> 
>         location = /test_post.php {
>             proxy_pass http://test;

-             proxy_pass http://test;
+             proxy_pass http://test/test_post.php;

>             internal;
>         }
> 
> Normal proxying works fine, but nginx does not appear to ever make the
> callback to test_post.php. Removing the test_post.php location results in a
> Redirect cycle error in my log. Does anyone know how to resolve this?

See above.  The proxy_pass without uri component uses original 
request uri (and post_action doesn't invalidate it currently).  So 
you have to use proxy_pass with explicitly set uri for this to 
work.

Maxim Dounin





More information about the nginx mailing list