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 a custom baseURL is set, it is expected that all routes (and static assets) will be prefixed with {baseURL}/ so one should go to https://<addr>/{baseURL}.
If a request hits https://<addr>/* outside of {baseURL}, nitro renders a 404 because there is no route.
#2713 proposed a DX improvement to auto redirect /* to /{baseURL}* (only in dev) however it causes issues (#2881) as there are valid cases that a middleware or proxy route rule might actually need to handle this fallback.
In summary: This a nice DX but has downside of limiting some advanced cases and also potentially more mismatch behavior between dev and prod runtime behavior.
I am thinking of some progressive steps to handle:
Improve dev error to show a hint that tells users it is 404 but hey, you might want need to go to this link.
Add an opt-in option to enable baseURL redirect (in two modes: fallback|enforce)
we should keep it opt-in for v2, we might enable by default for 3.0 however I'm not sure if trade-off worth it (if we do, we need clear docs about behavior and why/how opt-out)
The text was updated successfully, but these errors were encountered:
When a custom
baseURL
is set, it is expected that all routes (and static assets) will be prefixed with{baseURL}/
so one should go tohttps://<addr>/{baseURL}
.If a request hits
https://<addr>/*
outside of{baseURL}
, nitro renders a 404 because there is no route.#2713 proposed a DX improvement to auto redirect
/*
to/{baseURL}*
(only in dev) however it causes issues (#2881) as there are valid cases that a middleware or proxy route rule might actually need to handle this fallback.In summary: This a nice DX but has downside of limiting some advanced cases and also potentially more mismatch behavior between dev and prod runtime behavior.
I am thinking of some progressive steps to handle:
The text was updated successfully, but these errors were encountered: