莫大人

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

  

posted on 2019-02-25 12:55  莫大人  阅读(1753)  评论(0编辑  收藏  举报

导航