Nginx, SOAP and POST redirect

reallfqq-nginx at reallfqq-nginx at
Mon Oct 5 08:48:56 UTC 2015

Since you talk about using an authentication header, it seems to me you are using the basic access authentication HTTP method.Have you had a look at the (standard) basic authentication nginx module?
Maybe could you then apply basic authentication before applying some crafted redirection rules?

     Le Lundi 5 octobre 2015 7h22, router_master <nginx-forum at> a écrit :


I use nginx as frontend for some soap service. This service actually works
with CWMP protocol, what is based on soap. I mean, that I have session, that
consists of sequence of HTTP POST requests and responses, where body
contains SOAP.

It's important, that I can use only POST requests to communicate with
client. And there is a problem, that some clients has broken browsers (most
of the clients, actually) and it's not way to fix them quickly. And I want
to use redirects in this soap session (I mean 307 redirects) But,
unfortunately, some clients don't support redirects, because they are
broken. I know that there are some way to make nginx handling redirects
instead of the clients. I know about error_page, x-accel-redirect,
subrequests in nginx, echo module and other stuff. But all this methods have
significant disadvantages, mostly because they were designed for GET
requests, not for the POST.

For example, there is a question about doing redirect in nginx the way I
I tried it, but it turns my POST request into GET request and I loose the
body. It' may be connected with this:

There is another example, where are mentioned another methods to achieve
what I want:,254664,254664#msg-254664 But,
again, it's not clear how to use it if I want POST requests only

By the way, redirect may be not what I need. Exactly I need following:

    1. Client sends to me first message in the session.
    2. I answer with 401 (because I need authentication)
    3. Client sends to me the same message, but with authentication header
    4. I need to get the same first message third time, but on the another

Module ngx_http_auth_request_module is doing something close to what I want,
but, again, it has issues with POST method.

So, I don't know what to do. Maybe there are any hope that nginx can help me
or I should rely on another ways to do it? Or I should forget about doing

Please, help

Posted at Nginx Forum:,262003,262003#msg-262003

nginx mailing list
nginx at

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the nginx mailing list