Process http request before send it to the proxy

Sergey Brester serg.brester at sebres.de
Tue May 2 07:55:16 UTC 2017


 

Hi, 

If you want parse/modify request data before you pass it to upstream,
take a look at NGINX-UPLOAD-MODULE, that do it similar way you may need
- reads request (POST/multipart), save file-data into temp-file(s), and
rewrite arguments pointing to this new file(s).

If you want rather to do something like external authorization, the
handling like `auth_request` from `NGX_HTTP_AUTH_REQUEST_MODULE` may be
interesting for you. 

> Should i use a handler or a filter in order to work with proxy_pass? 

Filters mostly modify response resp. do the replacement in response
body/header (that will be already received from upstream via
proxy_pass), so it would be too late in your case. 

Regards,
sebres 

Am 02.05.2017 00:17, schrieb Aris Striglis: 

> Hello! 
> 
> I'm new to nginx, playing using the api and making some handlers and filters. Now what i would like to do is to 
> 
> process the request headers, call an external c library, do some work and pass the request to an upstream using proxy_pass. 
> 
> I read about http request processing phases and handler priority, but i am a little bit confused. 
> 
> Should i use a handler or a filter in order to work with proxy_pass? 
> 
> Thanks. 
> 
> aris 
> 
> _______________________________________________
> nginx-devel mailing list
> nginx-devel at nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx-devel [1]
 

Links:
------
[1] http://mailman.nginx.org/mailman/listinfo/nginx-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx-devel/attachments/20170502/38932775/attachment.html>


More information about the nginx-devel mailing list