Welcome! Log In Create A New Profile

Advanced

Accessing HTTP request headers in nginx module

Mapper Uno
March 27, 2014 07:06PM
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 numbers

etc..

I know in Mongoose web server's callback routine, you can easily access
custom HTTP header with an API like

const char *value = mg_get_header(connection, "OPERATION")

I could not find such an API in nginx. How can I get this functionality
in nginx module in handler routine ? Any help would be great

Thanks

--
Posted via http://www.ruby-forum.com/.

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Accessing HTTP request headers in nginx module

Mapper Uno March 27, 2014 07:06PM

Re: Accessing HTTP request headers in nginx module

B.R. March 27, 2014 07:18PM

Re: Accessing HTTP request headers in nginx module

Mapper Uno March 27, 2014 08:08PM

Re: Accessing HTTP request headers in nginx module

Mapper Uno March 28, 2014 04:08PM

Re: Accessing HTTP request headers in nginx module

Mapper Uno April 01, 2014 02:32AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 89
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