I'm trying to proxy requests so that when I call http://localhost:3000/basePath/api
it requests http://localhost:8080/api
. I'm using the experimental routerules from Nitro to do this:
export default defineNuxtConfig({
nitro: {
routeRules: {
"api/**": {
proxy: {
to: "http://localhost:8080/**"
}
}
}
},
experimental: {
payloadExtraction: false
},
runtimeConfig: {
public: {
backUrl: ''
}
},
app: {
baseURL: "/basePath",
}
})
The problem is that I want the redirection to be done to http://localhost:8080/api
but it's done to http://localhost:8080/basePath/api
. I don't understand how to keep the baseURL
in my Nuxt3 config but not to have it in the proxy URL when used with a wildcard.