nginx反向代理商将自己设置headers发送到后台应使用服务器
范例使用户前台请求带有headers app_key
注意:
默认header不允许_变量名,假如需要
在http段或者者server段加underscores_in_headers on;
发送后台方式为在server段或者者location段定义,前面有http_
proxy_set_header app_key ${http_app_key};
详细:
http {
underscores_in_headers on;
server {
location / {
proxy_pass http://bank/;
proxy_set_header app_key ${http_app_key};
}
}
}