I have tryeid to do something like this but it seems that variable $upstream_http_content_disposition is empty.. when I want to redirect to different url..
proxy_pass http://www.domainresultget.com;
set $x $upstream_http_content_disposition;
return 301 http://domaintest.com/test.php?x=$x;