Re: Accessing HTTP request headers in nginx module

2014-03-31 Thread Mapper Uno
I could finally get hold of all the http header fields. A nice link that describes how to access the headers http://wiki.nginx.org/HeadersManagement Thanks for all the replies. Mapper Uno wrote in post #1141373: > Thanks Maxim for your reply. Since I am newbie, please excuse my > questions. I

Re: Accessing HTTP request headers in nginx module

2014-03-28 Thread Mapper Uno
Thanks Maxim for your reply. Since I am newbie, please excuse my questions. I am still unable to retrieve the variable. All I have in the handler routine is: ngx_http_request_t *r I can see that r->headers_in.headers is a list, but then when you say $http_operation, it is confusing me. Could yo

Re: Accessing HTTP request headers in nginx module

2014-03-28 Thread Maxim Dounin
Hello! On Fri, Mar 28, 2014 at 01:06:00AM +0100, Mapper Uno wrote: > Thanks for reply. However, I am still not clear how to access the > "custom" headers in module handler. Pls see my comments inline. > > B.R. wrote in post #1141281: > > In nginx, you have the http_ embedded variable in the core

Re: Accessing HTTP request headers in nginx module

2014-03-27 Thread Mapper Uno
Thanks for reply. However, I am still not clear how to access the "custom" headers in module handler. Pls see my comments inline. B.R. wrote in post #1141281: > In nginx, you have the http_ embedded variable in the core > module >

Re: Accessing HTTP request headers in nginx module

2014-03-27 Thread B.R.
In nginx, you have the http_ embedded variable in the core module to access HTTP headers. You can build the logic the way you want (through mapor directives from the rewrite mo

Accessing HTTP request headers in nginx module

2014-03-27 Thread Mapper Uno
Hi, I am writing a small nginx module that needs to get/parse HTTP request header and depending on it's value, needs to be do something. ex. curl -X POST -H "OPERATION: add" http://localhost:80/calc to add 2 numbers ex. curl -X POST -H "OPERATION: divide" http://localhost:80/calc to divide 2