nginx转发时,发现request header中的token(key带下划线)不见了,导致后端报401
经查询,是nginx没有开启 underscores_in_headers on;
http {
include mime.types;
default_type application/octet-stream;
#log_format main '$remote_addr - $remote_user [$time_local] "$request" '
# '$status $body_bytes_sent "$http_referer" '
# '"$http_user_agent" "$http_x_forwarded_for"';
#access_log logs/access.log main;
sendfile on;
#tcp_nopush on;
underscores_in_headers on;
#keepalive_timeout 0;
keepalive_timeout 65;
#gzip on;
....
nginx reload 后 正常了。。。