fix: Vite HMR WebSocket 通过 nginx 代理,修复域名访问时的 ws 连接失败

This commit is contained in:
2026-07-10 18:01:08 +08:00
parent d9a8f42522
commit 5844741f24
2 changed files with 10 additions and 1 deletions

View File

@@ -5,6 +5,11 @@ export default defineConfig({
plugins: [vue()],
server: {
port: 5173,
host: "0.0.0.0",
hmr: {
protocol: "ws",
clientPort: 80,
},
proxy: {
"/api": {
target: "http://backend:8100",