I have the following setup and configured to send all /api requests to a different server:
location /api {
proxy_pass https://myapp.herokuapp.com;
rewrite ^/api/(.*) /$1 break;
}
My app sends a header (USER_CUSTOMER), when communicating directly with myapp.herokuapp.com from the app it works, but when requesting through the proxy server, the value appears NULL on the API Server.
The following works in NGINX, but I need the App to be able to set the value of USER_CUSTOMER.
location /api {
proxy_pass https://app.herokuapp.com;
proxy_set_header USER_CUSTOMER ABC;
rewrite ^/api/(.*) /$1 break;
}
I may have additional headers to send in the future, so I'm hoping there is a flag to pass all headers from the proxy to the API Server.
Ubuntu
nginx/1.1.19