search

Home  >  Q&A  >  body text

nginx reverse proxy, unable to download large files

RT, the configuration parameters are

upstream h39_server
{
    server x.x.x.39;
}
...
location ~ ^/h39
{
    proxy_redirect  off;
    proxy_pass http://h39:8080;
}

Small files are normal, large files can get the returned header, 200 is normal, and content-length is also available, but the data cannot be read and is blocked. Are there any parameters that need to be specified?

仅有的幸福仅有的幸福2835 days ago648

reply all(3)I'll reply

  • 巴扎黑

    巴扎黑2017-05-16 17:30:24

    It should be because of the buffer, just add the following configuration

    proxy_buffering off;
    

    reply
    0
  • 给我你的怀抱

    给我你的怀抱2017-05-16 17:30:24

    First check the error log of nginx under x.x.x.39. If you have not customized the path, the error.log is located under the /path/to/nginx_install_root/logs directory. Then try to solve it according to the error. If the error log is not opened, open it first.


    If you are not completely sure whether it is the following problem, you can give it a try. If the following error is found in the error log:

    2013/12/19 04:10:26 [crit] 21911#0: *65059 open() "/usr/local/server/nginx/fastcgi_temp/3/58/0000001583" failed (13: Permission denied) while reading upstream, client: 1.93.255.38, server: example.com, request: "GET /js/get_scripts.js.php?token=a08a84b3c2426dcb913c79cc112...
    

    Cause of the problem

    Nginx's fastcgi_temp directory has incorrect permissions, and the nginx sub-process (worker process; the master process runs under the root account, but all worker processes run under the user account according to the nginx configuration file) cannot write. I suddenly remembered that I had changed the directory permissions not long ago.

    Problem Solved

    The solution is simple once you know the cause. My nginx user configuration is www:www. Just change the permissions of the fastcgi_temp directory:

    chown -R www:www ./fastcgi_temp
    

    reply
    0
  • 某草草

    某草草2017-05-16 17:30:24

    Has the poster solved this problem? How to deal with it

    reply
    0
  • Cancelreply