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
When utilizing getRequestURL(event) inside Nitro middleware (or inside a Nitro plugin, etc.) in a Nuxt project, I would expect the origin and hostname to return the deployed hostname and origin of the request rather than an "internal" server origin/host or something hidden behind a CNAME.
Additional context
I utilized a Nuxt app as a reproduction. You should be able to see where I am attempting to retrieve and store the origin and hostname via getRequestURL in /server/middleware/set-origin.ts
I'm fully aware I could be missing something obvious or intended, so if this is the case, I'd greatly appreciate some help in understanding what's going on and what is to be expected based on the code in the reproduction.
Problem I'm trying to solve (simplified):
I have a Nuxt application that will be serving a multi-tenant application whereby the Nuxt layers provide all functionality, and content is loaded at runtime per tenant.
We will be utilizing dynamic subdomains to determine which tenant's app is being requested, so I'd expect to be able to utilize any request event to identify app1.example.com or app2.example.com based on the origin or hostname extracted via getRequestURL(event).
Logs
No response
The text was updated successfully, but these errors were encountered:
Environment
2.9.6
3.11.2
Reproduction
Describe the bug
When utilizing
getRequestURL(event)
inside Nitro middleware (or inside a Nitro plugin, etc.) in a Nuxt project, I would expect theorigin
andhostname
to return the deployed hostname and origin of the request rather than an "internal" server origin/host or something hidden behind a CNAME.Additional context
I utilized a Nuxt app as a reproduction. You should be able to see where I am attempting to retrieve and store the origin and hostname via
getRequestURL
in/server/middleware/set-origin.ts
I'm fully aware I could be missing something obvious or intended, so if this is the case, I'd greatly appreciate some help in understanding what's going on and what is to be expected based on the code in the reproduction.
Problem I'm trying to solve (simplified):
I have a Nuxt application that will be serving a multi-tenant application whereby the Nuxt layers provide all functionality, and content is loaded at runtime per tenant.
We will be utilizing dynamic subdomains to determine which tenant's app is being requested, so I'd expect to be able to utilize any request
event
to identifyapp1.example.com
orapp2.example.com
based on theorigin
orhostname
extracted viagetRequestURL(event)
.Logs
No response
The text was updated successfully, but these errors were encountered: