-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
dev mode ignoring X-Forwarded-Proto
and X-Forwarded-Host
headers
#11902
Comments
@yannishin Are the appropriate environment variables set at runtime in the built application? https://kit.svelte.dev/docs/adapter-node#environment-variables-origin-protocolheader-hostheader-and-port-header |
@Conduitry The description in the link above seems to apply to the settings when building, and I want it to apply in dev mode. |
X-Forwarded-Proto
and X-Forwarded-Host
headersX-Forwarded-Proto
and X-Forwarded-Host
headers
Ah, okay, if it's in dev mode, then you're not actually running any adapter-node code. What you're asking to do isn't currently supported. We could either add SvelteKit-level configuration for controlling this at dev time only (which feels a bit weird to me), or we could roll this into work to let adapter influence the dev-time behavior of apps (which feels like the better solution, but will take longer to settle on an API - #2304 / #3535). |
Because of this development with Cloudflare tunnel + SvelteKit is harder :( |
Discussed in #11900
Originally posted by yannishin February 26, 2024
I expected the return from the Hook to be event.url.host=ui.foo.com, event.url.protocol=https:, but it is returning event.url.host=ui_server/ui, event.url.protocol=http:.
How should I solve this issue?
Given that event.request.headers.get("X-Forwarded-Host") and event.request.headers.get("X-Forwarded-Proto") are returning null, it seems that the node server(adapter-node.) is not recognizing the X-Forwarded-??? headers.
For reference, the API Server developed with spring boot is correctly returning ui.foo.com, https:.
This is Nginx Config
upstream ui_server {
ip_hash;
ui.foo.com:17001;
keepalive 100;
}
The text was updated successfully, but these errors were encountered: