Variables in proxy_method

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 {
proxy_method PUT;
rewrite /POST/(.*) $1;


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


This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs