Open mathvbarone opened 3 years ago
I've literally been on this issue for 3 days, it's the worst possible service to deploy a Next (SSR) application, honestly. I have to do X applications per domain and run with an environment variable to indicate the current domain. :introducing-facepalm-here:
Hi folks, any news about domain routing with Amplify?
Theres some way we can work around it by ourselves in the meantime (without having to work with multiple branches or applications of the same code)?
Issue #2345 has the same problem.
We will celebrate 1 year with that and the #2345 issues without ANY solution, explanation, or workaround, that's sad.
You are announcing Next13 support now. This is an old unsolved bug, not a feature request.
up
We ran into the same issue where it just redirects to the default domain. They clearly state that it should be supported, but it doesn't seem to work out of the box with no further documentation.
We are now forced to deploy each language as a separate app and use rewrites to go from site.fr
to site.fr/fr-fr/
. Besides that we now need to use 13 rewrites to exclude the _next/
routes and other static files before rewriting everything from /<*>
to /fr-fr/<*>
.
Hello -- Any chance you could see if this is now working? We just made improvements to forward more headers which should help here
Is your feature request related to a problem? Please describe. We would like to have our website using i18n feature from NextJS based on Domain Routing.
The way Amplify was designed, it creates an internal
Cloudfront
to manage DNS and certificates, and forward the request to anotherCloudfront
attached to the branch.The problem is that, by adding a rewrite rule, no information is propagated about the
Host
and then NextJS can not redirect the request based on the domain. Check the diagram bellow:If I intercept the request between internal CloudFront and the one rewritten to Serverless these are the only headers propagated:
As you can see, no
Host
information, and since it is working as a reverse proxy,x-forwarded-host
should be added in order to make it consistent and possible to integrate it better into the other layers.Describe the solution you'd like Internal Cloudfront created by Amplify to manage DNS and Certificates should forward
x-forwarded-host
header, so nextjs can forward the request to the correct domain according to the request origin.