title: nginx proxy_pass based on whether request method is POST, PUT or DELETE
body: <p>I have two <a href="http://hforge.org/ikaaro" rel="noreferrer">iKaaro</a> instances running on port 8080 and 9080, where the 9080 instance is Read only.</p>
  
  <p>I am unsure how to use nginx for example if the request method is POST, PUT, DELETE then send to write instance (8080) else send to 9080 instance.</p>
  
  <p>I have done something using the location using the regex, but this is not correct.</p>
  
  <p>From <a href="http://wiki.nginx.org/HttpLuaModule" rel="noreferrer">http://wiki.nginx.org/HttpLuaModule</a> i see that there is the 'HTTP method constants' which can be called, so is it correct to add a location block as:</p>
  
  <pre><code>location ~* "(ngx.HTTP_POST|ngx.HTTP_DELETE|ngx.HTTP_PUT)" {
      proxy_pass http://127.0.0.1:8080;
  </code></pre>
  
  <p>Thanks</p>