明道云私有化部署遇到的坑。它使用了一个自定义http header md_pss_id
根据nginx文档说明,自定义header默认不会传递给upstream。
By default, nginx does not pass the header fields “Date”, “Server”, “X-Pad”, and “X-Accel-...” from the response of a proxied server to a client. The proxy_hide_header directive sets additional fields that will not be passed. If, on the contrary, the passing of fields needs to be permitted, the proxy_pass_header directive can be used.
需要如下配置:
underscores_in_headers on;
location / {
// other proxy config
proxy_set_header md_pass_id;
}