POST method with x-accel-redirect

Yong Li yrcompute at
Tue Dec 6 05:01:09 UTC 2016

Hi Nginx guru,

I am a new nginx user working on implementing a protected upload and
download service based on nginx. With an older version 1.4.6 I was able to
make it work. But since we upgraded it to 1.10.1 it seems the POST method
is changed to GET during the redirect.  I saw Maxim had a post (,263661,264440#msg-264440) describing
this issue.  But I am still not sure what does it mean by "x-accel-redirect
to a named location". I tried wrapping the *file_server* section below into
a named location, and *proxy_pass* to this named location inside my
x-accel-redirect section (the second location block below), but it does not
work for me.  Could you give some example or instruction how to achieve
this in my nginx config file?  Or should I apply a pitch to fix this issue

upstream file_server {
    server ***.***.***.***:8888;
    server ***.***.***.***:8888;

server {
   # This accepts file upload/download requests and passes the requests to
my tomcat web server that handles authentication
   location /api/v1/files {
        proxy_pass http://tomcat;
        proxy_cache backcache;

    # This is the internal uri path that the tomcat web server redirects to
after authentication
    location ~ ^/(all|groups|channels|users) {
        proxy_pass http://file_server;  # This is my file server. I tried
make this a named location, but didn't not work.

Thanks a lot and best regards,

- Yong
Y&R Computing
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the nginx mailing list