nginx自定义header头内容丢失

今天碰到,使用nginx做负载均衡,http  header自定义的参数不转发的问题。

发现带下划线的的自定义参数,不能转发,

soule下确实有这个情况:http://bbs.watchstor.com/thread-71311-1-1.html

原来默认 underscores_in_headers  为off.

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

syntax:	underscores_in_headers on | off;
default:	underscores_in_headers off;
context:	http, server

Enables or disables the use of underscores in client request header fields. When disabled, request header fields whose names contain underscores are marked as invalid and are subject to the ignore_invalid_headers directive.


syntax:	ignore_invalid_headers on | off;
default:	ignore_invalid_headers on;
context:	http, server
Controls whether header fields with invalid names should be ignored. Valid names are composed of English letters, digits, hyphens, and possibly underscores (as controlled by the  underscores_in_headers  directive).


你可能感兴趣的:(nginx自定义header头内容丢失)