processing a request without body

Vasiliy Soshnikov vasiliy.soshnikov at gmail.com
Wed Dec 13 20:00:46 UTC 2023


Sorry I'm bad. I understood that header filters won't help you. Use the
ACCESS PHASE handler, it should work fine for you.

On Wed, Dec 13, 2023 at 10:57 PM Vasiliy Soshnikov <
vasiliy.soshnikov at gmail.com> wrote:

> Hello,
>
> > Is there something similar done before?
> I'm thinking that you would like to test the incoming path and execute
> some logic.
>
> You could use a header filter for that and also you could keep a body
> filter for handling the request body.
> Also pls take a look into PHASEs, I'm thinking you could try to add your
> own ACCESS PHASE.
>
> And the last one: for keeping your context (some variables or data) for
> this request between filters, phases you could use request's context.
>
> Probably, examples would help you:
> https://github.com/dedok/nginx-tutorials
>
>
> On Wed, Dec 13, 2023 at 10:56 AM Muhammad Nuzaihan <zaihan at unrealasia.net>
> wrote:
>
>> Hi,
>>
>> I need to process requests with only URI path (without body) for a module.
>>
>> It seems ngx_http_request_body_filter_pt is *not* executed whenever
>> there is a request without a body (it looked like it bypassed without
>> request body) and only ngx_http_output_body_filter_pt  part of the
>> code is executed.
>>
>> For example i do a request curl curl like this:
>>
>> curl -vvvv -X POST http://localhost:8080/proxy/profile/alice/comment
>>
>> and i need to validate /proxy/profile/alice/comment in my module and
>> there is no http headers and no body. Only URI path.
>>
>> Is there something similar done before?
>>
>> Thank you,
>> Muhammad Nuzaihan
>> _______________________________________________
>> nginx-devel mailing list
>> nginx-devel at nginx.org
>> https://mailman.nginx.org/mailman/listinfo/nginx-devel
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx-devel/attachments/20231213/e805a909/attachment.htm>


More information about the nginx-devel mailing list