Skip to content
This repository was archived by the owner on Jan 28, 2025. It is now read-only.
This repository was archived by the owner on Jan 28, 2025. It is now read-only.

Passing correct Host header to _next/data/* #617

@Qubica

Description

@Qubica

Hello,

I'm setting up a Multilang Serverless NextJS project.
Based on the Host Header I like to retrieve the correct language via getServerSideProps.
domain.nl -> dutch, domain.eu -> english, domain.de -> german, ... etc

This is working for the dev server, on page load and on client side routing.
On AWS it's working for page load but failing for client side routing (_next/data/*)
When navigating on the client it's receiving the s3 domain as Host instead of the actual origin.
In Cloudfront I've added Host to the whitelist headers.

Who can help me solve this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions