Multiple subrequests, each with a proxy_pass

scompt nginx-forum at nginx.us
Wed Feb 2 14:40:54 MSK 2011


For a certain endpoint (/upload), I would like to sometimes (when
content-type matches) create a subrequest which calls an upstream with
proxy_pass to include content before the actual response, which is also
provided via proxy_pass. This isn't working right now and is only
returning the content of the subrequest's upstream. Is this even
possible? Here's the config that I'm using:

    [code]
    location "/" {
        if ($content_type ~ "^multipart/form-data") {
            echo_subrequest $request_method /saver2;
        }

        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header Host $http_host;
        proxy_pass http://assets;
   }

    location /saver2 {
        internal;
        rewrite / /__testing__/saver break;
        proxy_pass http://filesaver;
    }
[/code]

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,171508,171508#msg-171508




More information about the nginx mailing list