title: Creating a POST request with X-Accel-Redirect with Rails?
body: <p>I'm using rails 4 and I'm proxying a GET request to another server like this:</p>
  
  <pre><code>def proxy_video(path)
    self.status = 200
    response.headers["X-Accel-Redirect"] = "/proxy/#{path}"
    render text: 'ok'
  end
  </code></pre>
  
  <p>In my nginx config, I have this:</p>
  
  <pre><code>location ~* ^/proxy/(.*?)/(.*) {
      internal;
      resolver 127.0.0.1;
  
      # Compose download url
      set $download_host $1;
      set $download_url http://$download_host/$2;
  
      # Set download request headers
      proxy_set_header Host $download_host;
  
      # Do not touch local disks when proxying content to clients
      proxy_max_temp_file_size 0;
  
      # Stream the file back send to the browser
      proxy_pass $download_url?$args;
    }
  </code></pre>
  
  <p>This works fine for proxying GET requests like: </p>
  
  <pre><code>proxy_image('http://10.10.0.7:80/download?path=/20140407_120500_to_120559.mp4')
  </code></pre>
  
  <p>However, I want to proxy a request that passes a list of files that will not fit in a GET request. So I need to pass what currently goes in $args as POST data.</p>
  
  <p>How would I proxy this POST data? - Do I need to do something like response.method = :post or something? - Where would I provide the parameters of what I'm POSTing?</p>