默认情况下 nginx 是不会传递带有下划线的自定义 header 参数的,例如在 header 中传递 client_id,那么是无法传递给后端的,如果想要支持也很容易,在 nginx 的配置文件中进行配置就可以。

vi /etc/nginx/nginx.conf

找个位置增加下面这个配置就可以(如果存在,则将 off 改为 on 既可)

underscores_in_headers on;

然后重启 nginx 就可以

service nginx reload