post_action to a backend server

Paul Bowsher paul.bowsher at gmail.com
Sun Jan 25 15:32:17 MSK 2009


As a follow up, is there any way to get the amount of data sent in the
upstream request? I can then compare to content-length and see if the
request completed successfully or not. I have proxy_set_header
X-Original-Length $content_length, but this doesn't appear on the
post_action whereas proxy_set_header X-Original-Uri $request_uri does.

Thanks for your help :)

Paul Bowsher


On Sun, Jan 25, 2009 at 12:21 PM, Paul Bowsher <paul.bowsher at gmail.com>wrote:

> Perfect, thank you very much Maxim!
> Paul Bowsher
>
>
>
> On Sun, Jan 25, 2009 at 12:01 PM, Maxim Dounin <mdounin at mdounin.ru> wrote:
>
>> 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
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://nginx.org/pipermail/nginx/attachments/20090125/050171f1/attachment.html>


More information about the nginx mailing list