diff --git a/packages/vite/src/node/server/middlewares/proxy.ts b/packages/vite/src/node/server/middlewares/proxy.ts index d414e24d462efd..de72cfeb638e14 100644 --- a/packages/vite/src/node/server/middlewares/proxy.ts +++ b/packages/vite/src/node/server/middlewares/proxy.ts @@ -40,7 +40,7 @@ export function proxyMiddleware({ Object.keys(options).forEach((context) => { let opts = options[context] if (typeof opts === 'string') { - opts = { target: opts } as ProxyOptions + opts = { target: opts, changeOrigin: true } as ProxyOptions } const proxy = httpProxy.createProxyServer(opts) as HttpProxy.Server