NuxtN
Nuxt9mo ago
19 replies
Pablo

Can I redirect in a server plugin?

I have a server plugin that checks if a user is set in a cookie, and if not, redirects. The "navigateTo" function works for sending redirects in my dev environment (the "nuxt dev" command). But, it does not work when deployed and the web app is served by NGINX. I get the error "error Error: [nuxt] instance unavailable".

How can I properly do a redirect in my server plugin?
Was this page helpful?