Welcome! Log In Create A New Profile

Advanced

nginx module dev help: nginx http subrequest of type POST (including POST params)

February 23, 2015 02:42AM
Hi nginx experts!
This is my first post in this forum - I'm hoping you folks can throw some light on a problem I'm facing.

I'm trying to develop a module very similar to the ngx_http_auth_request_module (nginx.org/en/docs/http/ngx_http_auth_request_module.html). While seeing the source code, I realized that this uses ngx_http_subrequest to create a subrequest to a server, and the implementation of ngx_http_subrequest sets the type of request to a GET:

sr->method = NGX_HTTP_GET;

My use case is this - I need a module that performs authentication based on the subrequest (identical to the module). HOWEVER, the subrequest should include POST params (request body). This is required since the authentication server (that the subrequest points to) will use something like AWS's signing technique (http://docs.aws.amazon.com/general/latest/gr/sigv4_signing.html) to match signatures. This technique hashes the request body and verifies the hash - hence I need the subrequest to include the request body too.

Is there any way I can achieve this? I cannot seem to figure out how implement something like ngx_http_subrequest that would include POST params.

Help please :) !
Subject Author Posted

nginx module dev help: nginx http subrequest of type POST (including POST params)

quadmaniac February 23, 2015 02:42AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 313
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready