We are in the process of migrating our single-page app to Netlify. We have a REST API in our servers, so we are going to serve our frontend as static files from Netlify and proxy the
/api directory to our API in other domain.
That is working fine, but we need our API to know the original
Host header, since we are deploying our frontend in several domains and customizing some of the responses depending on the host that makes the request, but the netlify redirect substitutes the original
Host header with the host of the API, so this information is lost.
Is there any way to get the original host to our API server through redirects? It would be enough to be able to append this information to every request that goes through the proxy as a custom header or get parameter, but we haven’t been able to do so.
Any advice would be greatly appreciated!