Nginx——请求head被过滤

nginx代理服务器,app发出的请求头被直接过滤了,当时想到nginx会自动过滤掉带有_的请求头信息,所以直接改了Nginx的配置当然也可以将app的request中header中的_改为-

步骤

修改nginx配置,在http中增加

# vi /usr/local/nginx/conf/nginx.conf

underscores_in_headers on;

vhost中的配置也贴下吧

 location / {
        proxy_set_header  Host $host:80;
        proxy_set_header  X-Real-IP $remote_addr;
        proxy_set_header x-forwarded-for $remote_addr;
        proxy_pass http://xxxxxxx:51001;
  }