nginx reverse proxy, unable to download large files
仅有的幸福
仅有的幸福 2017-05-16 17:28:24
0
3
608

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?

仅有的幸福
仅有的幸福

reply all(3)
巴扎黑

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

proxy_buffering off;
给我你的怀抱

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
某草草

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

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!