request help: The response head was strangely modified after passing APISIX
Issue description
我通过修改本地的hosts对路由在postman上分别做了测试,一种是通过apisix,一种是直接访问后端的ip地址,结果是通过apisix后响应头被不知道什么原因的修改了,下面是不过apisix和过apisix的两种情况

这是后端往响应头上加头信息的代码:

没有开任何的插件,service配的也是穿透模式,不太明白为什么会这样。。
Environment
- apisix version (cmd:
apisix version):apache/apisix:2.3-alpine
adding Server header to the response header is a default behavior, indicating that the request is handled by APISIX, but overriding Access-Control-Allow-Headers is a problem, what are your upstream services?
upstream services is ingress-controller ,I can get the head if I bypass APISIX and visit the upstream
upstream services is ingress-controller ,I can get the head if I bypass APISIX and visit the upstream
what is the value of Access-Control-Allow-Headers in the request header?
这3个是用来cors跨越名访问用的, 还有我之前也有往头里加cache-control: no-cache(清除浏览器缓存)这个过完apisix后也不见了
This information seems to be carried with the cors plugin enabled. You check if the cors plugin is enabled.

是的 谢谢 确实有个全局插件cors!
目前我已经去掉了,而且保证了没有全局插件存在了,但是目前还是有那个响应头丢失的情况存在

过apisix后cache-control: no-cache没有了..
经过测试需要加上插件proxy-cache,并设置hide_cache_headers:false 才能返回给客户端,但是我不太明白为什么会这样呢,这个插件是必须要加的吗?
The proxy-cache plugin is not necessary, you can provide route related configuration data, I will check it.
{ "create_time": 1620454728, "update_time": 1620454728, "uris": [ "/bff-message-center", "/bff-message-center/*" ], "name": "gateway-test_XXXXXX___bff-message-XXXXXX", "methods": [ "GET", "HEAD", "POST", "PUT", "DELETE", "OPTIONS", "PATCH" ], "hosts": [ "gateway-test.XXXXXX" ], "service_id": "347097464416764780", "enable_websocket": true, "status": 1 } 这是这个路由配置, service上只开了prometheus插件
@StretchV the issue is fixed by https://github.com/apache/apisix/pull/3789 in v2.5?
I confirmed that it has been resolved in APISIX 2.5
那我可以先用proxy-cache这个插件配置hide_cache_headers:false 这种方式解决吗,会有什么影响吗,我目前吧这个插件配成全局插件了,我的是2.3版本
那我可以先用proxy-cache这个插件配置hide_cache_headers:false 这种方式解决吗,会有什么影响吗,我目前吧这个插件配成全局插件了,我的是2.3版本
This solution looks good to me. If possible, please upgrade to 2.5.
Consider solved by #3789