关于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;
}
解决这个问题,只需要禁止 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;
}
相关文章推荐
- nginx安装
- yii nginx 隐藏 index.php
- Nginx 笔记与总结(2)信号控制
- 详解 nginx location ~ .*\.(js|css)?$ 什么意思?
- Linux下nginx的一些问题
- nginx重写代码
- ab压nginx集群失败率的问题
- (转)nginx+iis实现负载均衡
- Centos7-64bit尝试编译最新版的nginx1.9.3+php7+mysql5.6.25
- nginx服务傻瓜搭建
- nginx服务傻瓜搭建
- nginx入门之安装
- nginx配置多个虚拟主机,只有其中某个有作用
- Flume对Nginx群集日志收集方案
- Nginx 作为web server 的优化要点
- lnmp全面优化集合nginx+mysql+php
- nginx+php-fpm+mysql分离部署详解
- 一、nginx介绍及安装
- Nginx代码调试——gdb工具
- CentOS 7.0编译安装Nginx1.6.0+MySQL5.6.19+PHP5.5.14