diff --git a/server/index.js b/server/index.js index 8a4297753..9e65770d0 100644 --- a/server/index.js +++ b/server/index.js @@ -10,16 +10,12 @@ app.use('/build', express.static('build')); const options = (target) => { return { target: target, - changeOrigin: true, // 允许在请求头中更改主机 + changeOrigin: false, // 允许在请求头中更改主机 timeout: 30000, - // 只改head版本不需要重写ua - // headers: { - // 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36 Edg/121.0.0.0' - // } }; } -const proxy = createProxyMiddleware(options('http://127.0.0.1:8081')); +const proxy = createProxyMiddleware(options('http://localhost:8081')); // 设置代理