看起来像nginx 0.8.35 可能支持分块传输编码 http://nginx.org/en/CHANGES:
2010 年 4 月 1 日 nginx 0.8.35 的变化
*) Change: now the charset filter runs before the SSI filter.
*) Feature: the "chunked_transfer_encoding" directive.
这很棒,因为我正在尝试通过 nginx 反向代理将 git 更改推送到 git-http-backend 进程。 Git HTTP 利用分块传输编码出于客户端效率原因 http://kerneltrap.org/mailarchive/git/2008/8/3/2795094.
但是,我无法让它工作。我在 Debian Lenny 上使用 nginx 0.8.44,并进行以下配置调用:
./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文件:
server {
server_name example.com;
location / {
proxy_pass http://192.168.0.10;
include /etc/nginx/proxy.conf;
chunked_transfer_encoding on;
}
}
And my 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;
我相信 chunked_transfer_encoding 默认处于启用状态。配置标志在添加到 server{} 作用域时可以正常工作,但在放置在 location{} 作用域中时无效。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)