#Is it possible to configure the Nitro server to only accept requests from the frontend?
2 messages · Page 1 of 1 (latest)
Hello! Based on the information provided in the knowledge sources, I don't have a direct answer to your specific question about configuring the Nitro server to only accept requests from the frontend. The documents don't contain explicit information about restricting Nitro server access in this way.
However, there are a few related concepts that might be helpful:
-
You can use the
nitrokey in the Nuxt configuration to set various Nitro-specific options. This allows for customization of the Nitro server behavior, although the exact option for restricting access is not mentioned. Nitro Config (https://nuxt.com/docs/guide/directory-structure/server#nitro-config) -
Nuxt provides a
corsoption in route rules, which can be used to control Cross-Origin Resource Sharing. While this doesn't directly restrict access to only the frontend, it can be used to manage which origins are allowed to make requests to your server. Route Rules (https://nuxt.com/docs/guide/concepts/rendering#route-rules) -
There's an experimental feature called
noVueServerthat disables the Vue server renderer endpoint within Nitro. While this doesn't exactly match your requirement, it shows that there are ways to modify Nitro's behavior. noVueServer (https://nuxt.com/docs/guide/going-further/experimental-features#novueserver)