【电商】nginx问题记录

1. 反向代理时,header信息丢失

自定义的header中带有下划线,nginx在做反向代理时,会认为这样的header是无效的,所以没有进行转发,需要配置underscores_in_headers,默认为off,改为on即可.

语法:

Syntax:	underscores_in_headers on | off;
Default:	
underscores_in_headers off;
Context: http, server

 

参见:http://nginx.org/en/docs/http/ngx_http_core_module.html#underscores_in_headers

 

2. upstream sent invalid chunked response while reading upstream

出现该问题的原因未知,

解决方法,增加下面的配置:

proxy_http_version 1.1;

配置项proxy_http_version的默认值为1.0,所以怀疑与1.1中的keepalive特性有关

你可能感兴趣的:(nginx,电商)