`baseURL` is not replaced when forwarding proxy #2708
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 11.2k
- Forks
- 899
- Avg merge
- 2d 24m
- Merged PRs (30d)
- 40
Description
Environment
Nitro v2
Reproduction
https://stackblitz.com/edit/github-fmxubecd
Describe the bug
With a baseURL + proxy, the base is included in the proxied request:
export default defineNitroConfig({
baseURL: '/app',
routeRules: {
'/api/v1/**': { proxy: { to: 'https://dummyjson.com/**' } },
},
});
So /app/api/v1/quotes/random does not correctly proxy to http://dummyjson.com/quotes/random.
previously reported without a reproduction in https://github.com/nitrojs/nitro/issues/2708
Additional context
No response
Logs
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the linked StackBlitz reproduction and the Nitro configuration using baseURL and routeRules proxy. Trace the proxy request handling to determine where the baseURL remains in the forwarded path, then verify that /app/api/v1/quotes/random forwards to the intended upstream path without the base prefix.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 65/100