location ... {
add_header yourHeaderName yourValue;
proxy_pass xxxx://xxx_my_proxy_addr_xxx;
# Now use this solution:
proxy_ignore_headers yourHeaderName // but set by proxy
# Or if above didn't work maybe this:
proxy_hide_header yourHeaderName // but set by proxy
}
我不确定它是否正是你所需要的,但是尝试一些操作这个方法,也许结果会适合你的问题。
你也可以使用这个组合:
proxy_hide_header headerSetByProxy;
set $sent_http_header_set_by_proxy yourValue;
# 1. hide the Access-Control-Allow-Origin from the server response
proxy_hide_header Access-Control-Allow-Origin;
# 2. add a new custom header that allows all * origins instead
add_header Access-Control-Allow-Origin *;