问题描述
鉴权key存放在header中,key为auth_user。本地联测正常,发布生产环境异常,auth_user参数丢失了。
解决方案
经核实,生产使用nginx,nginx默认过滤下划线参数。
方案一
调整key,去掉下划线即可。
方案二
调整nginx配置,在http中添加如下配置:
#默认 underscores_in_headers 为off,表示如果header name中包含下划线,则忽略掉。
underscores_in_headers on;
nginx配置调整参考链接:https://blog.csdn.net/u012279452/article/details/80605338
原文链接:https://blog.csdn.net/Dolphin_bobo/article/details/117783639