Welcome! Log In Create A New Profile

Advanced

forwarding POST requests to upstream

Michał Jaszczyk
April 06, 2009 06:03AM
Hey,

I work at a company where we use Nginx a lot and so far we are very
happy with it :). Now we want to add another feature to our website
and long story short we need to forward files that users send by POST
requests to backends. Now I know that there exists upload module for
Nginx, but it is a little bit not suitable for us because we would
like not to store request body on disk, but instead immediately
forward it to backend, even without storing the request body in
memory, i.e. initiate request to backend as soon as the request to
Nginx is started. Another gotcha is that the backend has to be chosen
in a way that might require sending one more request to determine the
backend.

In other words, this is what we would like to achieve:
1. User sends file to Nginx using POST.
2. Nginx sends request to an application server.
3. The application server returns address of one of backend servers
(something like X-Accel-Redirect, but for POST).
4. Nginx forwards user's request to the backend, but doesn't store
request body on disk or in memory.

There were some posts on the group regarding similar topics and it
looks like it can't be done in Nginx yet. So I will probably have to
write a module that combines functionality from upstream and upload
modules. Or maybe it can be done in some other way? I remember a
discussion about input filter chain a week or two ago. This may ease
the task, but the chain is not ready yet and I'm in a bit of hurry and
I guess I can't wait until it's ready.

What are your thoughts about this problem? Any comment or hint will be
appreciated :).

Cheers,

Michał Jaszczyk
Subject Author Posted

forwarding POST requests to upstream

Michał Jaszczyk April 06, 2009 06:03AM

Re: forwarding POST requests to upstream

Valery Kholodkov April 06, 2009 11:05AM

Re: forwarding POST requests to upstream

Michał Jaszczyk April 06, 2009 11:45AM

Re: forwarding POST requests to upstream

Igor Sysoev April 06, 2009 12:41PM

Re: forwarding POST requests to upstream

Michał Jaszczyk April 06, 2009 01:45PM

Re: forwarding POST requests to upstream

Igor Sysoev April 07, 2009 03:02AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 101
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready