Welcome! Log In Create A New Profile

Advanced

Modify POST request and forward to Naxsi

Posted by lenjor 
Modify POST request and forward to Naxsi
August 27, 2015 04:12AM
Is it possible to create an nginx module which can receive a POST request, modify it, then forward it to the naxsi module?

The background to the question is the following:
There are clients performing measurements and communicating (on a slow GPRS connection) with a server (which resides behind a web application firewall) using POST requests. For some clients, there is a bug which sometimes make the client stop sending data before all data in the POST request has been sent. The server which handles the POST request can often tolerate that some data is missing. As an alternative to fix the bug in all clients in the field, we have an idea to let the clients connect to an intermediate server which receives POST requests, and if an acceptable small part of the data is missing (using a timeout), adjust the Content-Length of the request, and forward the request to the server. The server then processes the data and sends an OK message back, which the intermediate server then forwards to the client.

I have started to learn about nginx, and I think it should be possible to create a handler processing the POST request, and forward the (possibly adjusted) request to an upstream server through the naxsi module. Am I right?

Thanks in advance!
Re: Modify POST request and forward to Naxsi
August 27, 2015 06:10AM
Naxsi is not going to do much for you, look into Lua (openresty) where you can do these kind of things, see also https://groups.google.com/forum/#!forum/openresty-en

---
nginx for Windows http://nginx-win.ecsds.eu/
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 124
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready