免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 2900 | 回复: 1

[Web] 【已解决】nginx反向代理 文件下载总是中断 [复制链接]

论坛徽章:
0
发表于 2015-06-18 20:19 |显示全部楼层
本帖最后由 xiangbei1573 于 2015-06-18 21:07 编辑

nginx 主配置文件:
user  www www;
worker_processes 2;
error_log  /data/logs/nginx/error.log  crit;
pid        /var/run/nginx.pid;
worker_rlimit_nofile 65535;
events
{
  use epoll;
  worker_connections 65535;
}
http
{
  include       mime.types;
  default_type  application/octet-stream;
  access_log off;
  #charset  gb2312;
  server_names_hash_bucket_size 128;
  client_header_buffer_size 32k;
  large_client_header_buffers 4 32k;
  client_max_body_size 80m;
  sendfile on;
  tcp_nopush     on;
  keepalive_timeout 300;
  tcp_nodelay on;
  fastcgi_connect_timeout 3000;
  fastcgi_send_timeout 3000;
  fastcgi_read_timeout 3000;
  fastcgi_buffer_size 128k;
  fastcgi_buffers 4 128k;
  fastcgi_busy_buffers_size 256k;
  fastcgi_temp_file_write_size 256k;
  #limit_zone  crawler  $binary_remote_addr  10m;
  upstream svn {
    ip_hash;
    server 192.168.0.xx:88 max_fails=3 fail_timeout=30s;
  }
  include vhosts/vhosts.conf;
}



vhosts文件:
server {
    listen 88;
    server_name  10.10.10.x;
    root /data/wwwroot;
    index index.html index.php;
    error_log  /data/logs/nginx/access_error.log;
    access_log  /data/logs/nginx/access.log;

    location / {
        proxy_set_header Host $host;
        proxy_next_upstream error timeout invalid_header http_500 http_502 http_504;

        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        #proxy_set_header http_x_forwarded_for $remote_addr;
        proxy_set_header REMOTE_ADDR $remote_addr;
       # proxy_set_header X-REAL-IP $remote_addr;

        proxy_pass  svn;
    }
}



当下载文件为74M时,总是报这个错误:
2015/06/18 18:14:42 [crit] 3955#0: *19 writev() "/opt/nginx-1.2.7/proxy_temp/0/01/0000000010" has written only 7168 of 8192 while reading upstream, client: 10.10.10.xx, server: 10.10.10.xx, request: "GET artifactoryxx HTTP/1.0", upstream: " 192.168.0.xxxx", host: "10.10.10.xx"

百度、雅虎、google镜像都查了一下,可惜没看到相似的答案,我觉得应该是fascgi或这是proxy的一些参数问题,但是真不清楚该怎么调整,请大家帮帮忙,谢谢了!

论坛徽章:
0
发表于 2015-06-18 21:07 |显示全部楼层
在vhosts里设置proxy_max_temp_file_size 0;
解决问题。
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP