<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Dec 23, 2015 at 7:19 PM, Maxim Dounin <span dir="ltr"><<a href="mailto:mdounin@mdounin.ru" target="_blank">mdounin@mdounin.ru</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Wed, Dec 23, 2015 at 07:10:43PM +0300, Руслан Закиров wrote:<br>
<br>
> On Wed, Dec 23, 2015 at 6:49 PM, Maxim Dounin <<a href="mailto:mdounin@mdounin.ru">mdounin@mdounin.ru</a>> wrote:<br>
><br>
> > X-Accel-Redirect changes a request from POST to GET.<br>
> ><br>
><br>
> No, it doesn't. Getting request method POST on the backend and even form<br>
> data is intact.<br>
<br>
</span>It does,<br>
<a href="http://hg.nginx.org/nginx/file/tip/src/http/ngx_http_upstream.c#l2501" rel="noreferrer" target="_blank">http://hg.nginx.org/nginx/file/tip/src/http/ngx_http_upstream.c#l2501</a>:<br>
<br>
            if (r->method != NGX_HTTP_HEAD) {<br>
                r->method = NGX_HTTP_GET;<br>
            }<br>
<br>
Though it looks like it only does so for nginx itself, and this<br>
indeed looks like a bug.  The code should be similar to one in<br></blockquote><div><br></div><div>Would you create an issue for this in tracker or do I need to so it doesn't disappear in archives?</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
error_page handling:<br>
<br>
        if (r->method != NGX_HTTP_HEAD) {<br>
            r->method = NGX_HTTP_GET;<br>
            r->method_name = ngx_http_core_get_method;<br>
        }<br>
<br>
If you want to get request and request method intact, use<br>
X-Accel-Redirect to a named location instead.</blockquote></div><br>Understood and it works for our case. We actually don't want to send POST requests to location that issues internal redirects (our HRU service), but we haven't found good way to avoid it.<br><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><div>Руслан Закиров</div><div>Руководитель отдела разработки веб-сервисов</div><div><span>+7(916) 597-92-69</span>, <span>ruz @ <a href="http://www.sports.ru/" target="_blank"><img src="http://farm7.static.flickr.com/6235/6210250811_19a888dbba_o.jpg" width="43" height="14" style="vertical-align:bottom;margin-right:0px"></a></span></div></div></div>
</div></div>