If app fetches http://site.ru/api/auth, then I get html, but not correct response from http://localhost:3000/api
Describe the bug
Hello eveeryone!
I use nginx as my reverse proxy to get access to my frontend (which is nuxt3 built with nitro.preset: 'service-worker') and some backend on localhost:3000.
When my app tries to get "/api/auth", I get response with html content (I think this happens from serviceworker).
Is there any ways to exclude paths "/api/....." from routing inside serviceWorker?
P.S. If I use default nitro.preset and use proxy_pass for my frontend, it works great. So nginx routing also works correctly
I think the service worker preset wouldn't work in your case as you're serving your Nuxt app with node. Have you tried one of the node presets ? https://nitro.unjs.io/deploy/node
Environment
Reproduction
Build nuxt project with
ssr: false
andnitro.preset: 'service-worker'
Configure nginx config like ` server {
} `
If app fetches
http://site.ru/api/auth
, then I get html, but not correct response from http://localhost:3000/apiDescribe the bug
Hello eveeryone!
I use nginx as my reverse proxy to get access to my frontend (which is nuxt3 built with
nitro.preset: 'service-worker'
) and some backend onlocalhost:3000
.When my app tries to get "/api/auth", I get response with html content (I think this happens from serviceworker).
Is there any ways to exclude paths "/api/....." from routing inside serviceWorker?
P.S. If I use default nitro.preset and use proxy_pass for my frontend, it works great. So nginx routing also works correctly
Additional context
Logs
No response