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






