# Variables in proxy\_method

**URL:** <https://www.ruby-forum.com/t/variables-in-proxy-method/125324>\
**Category:** NGINX\
**Created:** [January 8, 2008, 8:52am UTC](https://www.ruby-forum.com/t/variables-in-proxy-method/125324 "2008-01-08T08:52:56Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jed\_Schmidt](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/8e7dd6/32.png) [@Jed\_Schmidt](https://www.ruby-forum.com/u/Jed_Schmidt)\
**Post date:** [January 8, 2008, 8:52am UTC](https://www.ruby-forum.com/t/variables-in-proxy-method/125324/1 "2008-01-08T08:52:56Z")

</div>

Hello all,

Is there any chance that proxy\_method could be modified to allow  
variables? I’d like to proxy all incoming POST requests using PUT (for  
use with Amazon S3) like this:

set $s3\_method $request\_method;  
if ($request\_method = POST) {  
set $s3\_method PUT;  
}

location / {  
proxy\_method $s3\_method;  
…  
}

but there’s currently no way to change only one method without adding  
crufty URI rules like this:

if ($request\_method = POST) {  
rewrite ^/(.\*)$ /POST/$1;  
}

location /POST {  
internal;  
proxy\_method PUT;  
rewrite /POST/(.\*) $1;  
…  
}

I hope this makes sense, but let me know if I’m missing something,

Jed
