今天获取header头信息中参数access_token返回为null,本地用postman测试没问题,发布到线上环境就出问题了。
后面发现是nginx代理的过程中参数被过滤了,nginx中header携带下划线的字段信息会被过滤掉,需要在nginx.conf配置文件http配置块里面加个配置:underscores_in_headers on;
http {
underscores_in_headers on;
}
今天获取header头信息中参数access_token返回为null,本地用postman测试没问题,发布到线上环境就出问题了。
后面发现是nginx代理的过程中参数被过滤了,nginx中header携带下划线的字段信息会被过滤掉,需要在nginx.conf配置文件http配置块里面加个配置:underscores_in_headers on;
http {
underscores_in_headers on;
}