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;
- }