You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Yes, we change the host header in the proxy component to match the host of the API Gateway.
This happens because we don't add custom domains to the API Gateway distribution and therefore the gateway would reject requests from foreign hosts.
Unfortunately we don't change the header back to the original host from the viewer before calling the Lambda which causes that the API or SSR pages see the internal API Gateway endpoint as host.
Proposed solution:
We add a new header x-forwarded-host in the proxy component that contains the original host header from the viewer when we change the host header to API Gateway endpoint.
Before calling the Lambda (in node-bridge) we then replace the host header with the value from x-forwarded-host.
When accessing the Host header in my SSR pages or APIs, I get an API Gateway domain instead of the CloudFront distribution or my domain name.
https://github.com/serverless-nextjs/serverless-next.js#when-accessing-the-host-header-in-my-ssr-pages-or-apis-i-get-an-s3-domain-instead-of-the-cloudfront-distribution-or-my-domain-name
The text was updated successfully, but these errors were encountered: