您的位置:首页 > 运维架构 > Nginx

关于nginx的Transfer-Encoding: chunked

2015-07-23 09:30 573 查看
nginx默认提供php网页的时候   Transfer-Encoding: chunked 导致如果自己需要抓数据来用的 时候解码很麻烦。

 解决这个问题,只需要禁止 nginx 进行多余的 chunked 过程。经查,可以在 nginx 配置文件中相应网站的 location 段中加一行“chunked_transfer_encoding off;”。

location / {
        proxy_pass              http://10.0.0.10/;         proxy_redirect          off;
        proxy_set_header        Host            $http_host;
        proxy_set_header        X-Real-IP       $remote_addr;
        proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;
        chunked_transfer_encoding       off;
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: