I
I
Ivan Ivanov2016-06-05 11:14:48
Nginx
Ivan Ivanov, 2016-06-05 11:14:48

How to multi-thread send a remote file through nginx?

Part of nginx config:

#my download internal redirect		
location ~* ^/internal_redirect/ {
    internal;

  access_log /var/log/internal_redirect.access.log;
  error_log /var/log/internal_redirect.error.log;
   

    resolver 8.8.8.8;
 
    proxy_buffering off;
    proxy_set_header Content-Length ""; 
    proxy_set_header Cookie ""; 

    
  proxy_hide_header x-amz-request-id;
    proxy_hide_header x-amz-meta-uid;
    proxy_hide_header x-amz-id-2;
    proxy_hide_header x-amz-meta-mode;
    proxy_hide_header x-amz-meta-mtime;
    proxy_hide_header x-amz-meta-gid;
    proxy_hide_header x-amz-version-id;
    proxy_hide_header accept-ranges;
 

    proxy_method GET;
    proxy_pass_request_body off;
    proxy_max_temp_file_size 0;
 
    set $download_url http://$arg_url;
 
    proxy_pass $download_url;
  }

When I use in php
header("X-Accel-Redirect: /internal_redirect/?url=site.ru/path_to_file.mp3");

download works, but single-threaded, why so? And with the same config on another server, multi-threaded downloading works. Only on another server ispmanager and debian 7 x64, and on the current vestacp and debian 8 x64

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question