问题描述:在请求时往请求头header中放入了签名channel_id信息,在接收请求时再从header中拿出,在本地调试时是可以的,但通过NGINX代理之后发现拿不到,重新尝试放入
channelid测试,发现可以获取到channelid的值
方法一:不用下划线
把下划线_改成其他的,如channel_id改成channelid
方法二:从根本解除nginx的限制
nginx默认request的header的那么中包含’_’时,会自动忽略掉。
解决方法是:在nginx里的nginx.conf配置文件中的http部分中添加如下配置:
underscores_in_headers on; (默认 underscores_in_headers 为off)
原文链接:https://blog.csdn.net/shidebin/article/details/86133762