nginx反向代理商增加自己设置headers
来源:爱运维     阅读:882
动风网络
发布于 2018-07-27 23:32
查看主页
nginx反向代理商增加自己设置headers

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};

}

}

}

免责声明:本文为用户发表,不代表网站立场,仅供参考,不构成引导等用途。 系统环境 服务器应用
相关推荐
前台新人写简历的大概套路
Centos7配置ssh、rsh免密互信集群服务
我为什么要放弃 RESTful,选择拥抱 GraphQL
js解决java中的占位符,全局替换括号中的数据
小程序新请假界面
首页
搜索
订单
购物车
我的