Nevermind my previous post. I solved it finally :)

    location /foo {
        rewrite_by_lua '
            res = ngx.location.capture("/bar", {method = ngx.HTTP_POST, body
= "jjj"})
            res = ngx.location.capture("/bar", {method = ngx.HTTP_POST, body
= res.body})
            ngx.print(res.body)
        ';
    }

    location /bar {
        proxy_pass http://wservers;
    }



[vm ~]$ curl localhost:8080/bar -X POST --data 'hello'
UPSTREAM: hello :UPSTREAM
[vm ~]$ curl localhost:8080/foo -X POST --data 'hello'
UPSTREAM: UPSTREAM: jjj :UPSTREAM :UPSTREAM


Thank you so much!! You saved me a lot of time.

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

_______________________________________________
nginx mailing list
[email protected]
http://mailman.nginx.org/mailman/listinfo/nginx

Reply via email to