Variables in proxy_method

Jed Schmidt tr at nslator.jp
Tue Jan 8 10:44:51 MSK 2008


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 


More information about the nginx mailing list