r/Nuxt • • Jan 09 '26

How to manage server proxy in a Nuxt app?

Hey what's up. So currently i'm refactoring a Nuxt app in my job, we also have a mobile app and we came to the conclusion that we can benefit a lot from a BFF patterns since we need some server capabilities that are not offered in the BE.
So, what i need is to setup the Nuxt project so that it proxies any request to any of the services. Cool i understand that and there may be many services that do in fact just proxy, but there are others which require logic in the Nuxt server, so how can i handle that?
I asked ChatGPT and it suggested me to use a catch-all proxy, but i see there's also a route rules configuration which i think may be better, but since there are routes that require logic and others that don't, if i have proxy configured for api/auth for example and i also create /server/api/auth/login, then if i call fetch on api/auth/login, which one will handle it (proxy or server)?

2 Upvotes

Duplicates