启用Nginx分块传输编码

编程入门 行业动态 更新时间:2024-10-25 08:23:32
本文介绍了启用Nginx分块传输编码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

nginx 0.8.35可能支持分块传输编码:

使用nginx 0.8.35进行的更改2010年4月1日

Changes with nginx 0.8.35 01 Apr 2010 *) Change: now the charset filter runs before the SSI filter. *) Feature: the "chunked_transfer_encoding" directive.

这很棒,因为我正在尝试通过nginx反向代理将git更改推到git-http-backend进程.出于客户端效率方面的考虑,Git HTTP利用分段传输编码 .

This is great, because I'm trying to get push git changes through an nginx reverse proxy to a git-http-backend process. Git HTTP takes advantage of chunked transfer encoding for client-side efficiency reasons.

但是,我无法正常工作.我在Debian Lenny上使用nginx 0.8.44,并进行以下配置调用:

However, I can't get it to work. I'm using nginx 0.8.44 on Debian Lenny with the following configure invocation:

./configure \ --sbin-path=/usr/sbin \ --conf-path=/etc/nginx/nginx.conf \ --error-log-path=/var/log/nginx/error.log \ --http-log-path=/var/log/nginx/access.log \ --user=www-data \ --group=www-data \ --pid-path=/var/run/nginx.pid \ --lock-path=/var/lock/nginx.lock \ --with-http_ssl_module \ --with-http_gzip_static_module \ --with-http_realip_module

以及以下conf文件:

And the following conf file:

server { server_name example; location / { proxy_pass 192.168.0.10; include /etc/nginx/proxy.conf; chunked_transfer_encoding on; } }

我的proxy.conf看起来像这样:

proxy_redirect off; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; client_max_body_size 100M; client_body_buffer_size 128k; proxy_connect_timeout 90; proxy_send_timeout 90; proxy_read_timeout 90; proxy_buffer_size 4k; proxy_buffers 4 32k; proxy_busy_buffers_size 64k; proxy_temp_file_write_size 64k;

推荐答案

我在ServerFault上问了同样的问题,并得到了以下答案:

I asked the same question on ServerFault and got this answer:

serverfault/questions/159313/enabling-nginx -chunked-transfer-encoding/187573#187573

更多推荐

启用Nginx分块传输编码

本文发布于:2023-11-14 04:47:54,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1586261.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:Nginx

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!