I am using rails 4 and I am proxying a GET request to another server as follows:
def proxy_video(path)
self.status = 200
response.headers["X-Accel-Redirect"] = "/proxy/#{path}"
render text: 'ok'
end
In my nginx configuration, I have the following:
location ~* ^/proxy/(.*?)/(.*) {
internal;
resolver 127.0.0.1;
set $download_host $1;
set $download_url http://$download_host/$2;
proxy_set_header Host $download_host;
proxy_max_temp_file_size 0;
proxy_pass $download_url?$args;
}
This is great for proxying GET requests, for example:
proxy_image('http://10.10.0.7:80/download?path=/20140407_120500_to_120559.mp4')
However, I want to proxy a request that passes a list of files that will not fit into a GET request. Therefore, I need to pass what is currently included in $ args as POST data.
How can I proxy this POST data? - Do I need to do something, for example response.method =: post or something else? - Where can I specify the parameters of what I get?
source
share