https://www.cnblogs.com/gyfluck/p/8320294.html
HTTP头是可以包含英文字母([A-Za-z])、数字([0-9])、连接号(-)hyphens, 也可义是下划线(_)。在使用nginx的时候应该避免使用包含下划线的HTTP头。主要的原因有以下2点。
1.默认的情况下nginx引用header变量时不能使用带下划线的变量。要解决这样的问题只能单独配置underscores_in_headers on。
2.默认的情况下会忽略掉带下划线的变量。要解决这个需要配置ignore_invalid_headers off。
http {
include mime.types;
default_type application/octet-stream;
log_format main '$http_orig_client_ip - $remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for" "$upstream_addr" ';
sendfile on;
underscores_in_headers on;
ignore_invalid_headers off;
keepalive_timeout 65;
upstream test2081{
server 10.209.128.28:2081;
}
通过header头,传递参数到后端,php会自动在header的key前面加上HTTP_
但是如果header中带_会忽略
header参数是如何传递到 $_SERVER全局变量的?需要查阅cgi文档
https://bbs.csdn.net/topics/392468081