<html><body><div style="color:#000; background-color:#fff; font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:16px"><div id="yui_3_16_0_1_1444034137567_5436"><span>Hello,</span></div><div id="yui_3_16_0_1_1444034137567_5676"><br><span></span></div><div id="yui_3_16_0_1_1444034137567_5519"><span id="yui_3_16_0_1_1444034137567_5678">Since you talk about using an authentication header, it seems to me you are using the basic access authentication HTTP method.</span></div><div id="yui_3_16_0_1_1444034137567_5709"><span id="yui_3_16_0_1_1444034137567_5678">Have you had a look at the (standard) <a id="yui_3_16_0_1_1444034137567_6127" href="http://nginx.org/en/docs/http/ngx_http_auth_basic_module.html">basic authentication</a> nginx module?</span></div><div id="yui_3_16_0_1_1444034137567_6200"><br><span id="yui_3_16_0_1_1444034137567_5678"></span></div><div id="yui_3_16_0_1_1444034137567_6202"><span id="yui_3_16_0_1_1444034137567_5678">Maybe could you then apply basic authentication before applying some crafted redirection rules?</span></div><br><div class="qtdSeparateBR"><br><br></div><div style="display: block;" class="yahoo_quoted"> <div style="font-family: HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif; font-size: 16px;"> <div style="font-family: HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif; font-size: 16px;"> <div dir="ltr"> <font face="Arial" size="2"> Le Lundi 5 octobre 2015 7h22, router_master <nginx-forum@nginx.us> a écrit :<br> </font> </div>  <br><br> <div class="y_msg_container">Hello,<br><br>I use nginx as frontend for some soap service. This service actually works<br>with CWMP protocol, what is based on soap. I mean, that I have session, that<br>consists of sequence of HTTP POST requests and responses, where body<br>contains SOAP.<br><br>It's important, that I can use only POST requests to communicate with<br>client. And there is a problem, that some clients has broken browsers (most<br>of the clients, actually) and it's not way to fix them quickly. And I want<br>to use redirects in this soap session (I mean 307 redirects) But,<br>unfortunately, some clients don't support redirects, because they are<br>broken. I know that there are some way to make nginx handling redirects<br>instead of the clients. I know about error_page, x-accel-redirect,<br>subrequests in nginx, echo module and other stuff. But all this methods have<br>significant disadvantages, mostly because they were designed for GET<br>requests, not for the POST.<br><br>For example, there is a question about doing redirect in nginx the way I<br>want:<br><a href="http://serverfault.com/questions/423265/how-to-follow-http-redirects-inside-nginx" target="_blank">http://serverfault.com/questions/423265/how-to-follow-http-redirects-inside-nginx</a><br>I tried it, but it turns my POST request into GET request and I loose the<br>body. It' may be connected with this:<br><a href="https://en.wikipedia.org/wiki/Post/Redirect/Get" target="_blank">https://en.wikipedia.org/wiki/Post/Redirect/Get</a><br><br>There is another example, where are mentioned another methods to achieve<br>what I want: <a href="http://forum.nginx.org/read.php?2,254664,254664#msg-254664" target="_blank">http://forum.nginx.org/read.php?2,254664,254664#msg-254664 </a>But,<br>again, it's not clear how to use it if I want POST requests only<br><br>By the way, redirect may be not what I need. Exactly I need following:<br><br>    1. Client sends to me first message in the session.<br>    2. I answer with 401 (because I need authentication)<br>    3. Client sends to me the same message, but with authentication header<br>    4. I need to get the same first message third time, but on the another<br>URL.<br><br>Module ngx_http_auth_request_module is doing something close to what I want,<br>but, again, it has issues with POST method.<br><br>So, I don't know what to do. Maybe there are any hope that nginx can help me<br>or I should rely on another ways to do it? Or I should forget about doing<br>redirects?<br><br>Please, help<br><br>Posted at Nginx Forum: <a href="http://forum.nginx.org/read.php?2,262003,262003#msg-262003" target="_blank">http://forum.nginx.org/read.php?2,262003,262003#msg-262003</a><br><br>_______________________________________________<br>nginx mailing list<br><a ymailto="mailto:nginx@nginx.org" href="mailto:nginx@nginx.org">nginx@nginx.org</a><br><a href="http://mailman.nginx.org/mailman/listinfo/nginx" target="_blank">http://mailman.nginx.org/mailman/listinfo/nginx</a><br><br><br></div>  </div> </div>  </div></div></body></html>