nginx自定义header支持

今天配置nginx的时候遇到一个问题,直接访问接口没有问题,但是通过nginx转发之后,总是报token失效,无法获取token值,发现请求头丢失了。

默认是不支持非nginx标准的用户自定义header的,如果需要
在http段或者server段加underscores_in_headers on;
http {
  underscores_in_headers on;
  server {
    location / {
      proxy_pass http://bank/;
      proxy_set_header app_key ${http_app_key};
    }
  }
}

  

猜你喜欢

转载自www.cnblogs.com/yun965861480/p/10430332.html