Skip to content

How to handle host headers #753

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
vicb opened this issue Feb 26, 2025 · 0 comments
Open

How to handle host headers #753

vicb opened this issue Feb 26, 2025 · 0 comments
Labels
enhancement New feature or request question Further information is requested

Comments

@vicb
Copy link
Contributor

vicb commented Feb 26, 2025

ref/discussion: see #752

When OpenNext is behind a reverse proxy (i.e. aws wrappers) the host can be retrieved from header["x-forwarded-host"].
For Node, it depends how the infra is setup (behind a RP or not).

We also have this:

if (initialHeaders["x-forwarded-host"]) {
initialHeaders.host = initialHeaders["x-forwarded-host"];
}

header["x-forwarded-host"] should not be trusted if not behind a reverse proxy as it can be forged.

We should figure out the best way to configure this.

@vicb vicb added enhancement New feature or request question Further information is requested labels Feb 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant