在进行第三方接口管理的时候,需要添加trace 请求头,但是在使用nginx转发的时候,请求头丢失,以至于所有的请求都进不去。
配置转发
location /xyidc-api-prestowage {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://192.168.0.246:8099;
}
修改http模块
ttp {
include mime.types;
default_type application/octet-stream;
underscores_in_headers on;
.......
最重要的是:
underscores_in_headers on;
然后
nginx -s reload