fix: Vite HMR WebSocket 通过 nginx 代理,修复域名访问时的 ws 连接失败
This commit is contained in:
@@ -27,7 +27,11 @@ export default defineConfig({
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
server: {
|
server: {
|
||||||
host: "127.0.0.1",
|
host: "0.0.0.0",
|
||||||
port: 5174,
|
port: 5174,
|
||||||
|
hmr: {
|
||||||
|
protocol: "ws",
|
||||||
|
clientPort: 80,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -5,6 +5,11 @@ export default defineConfig({
|
|||||||
plugins: [vue()],
|
plugins: [vue()],
|
||||||
server: {
|
server: {
|
||||||
port: 5173,
|
port: 5173,
|
||||||
|
host: "0.0.0.0",
|
||||||
|
hmr: {
|
||||||
|
protocol: "ws",
|
||||||
|
clientPort: 80,
|
||||||
|
},
|
||||||
proxy: {
|
proxy: {
|
||||||
"/api": {
|
"/api": {
|
||||||
target: "http://backend:8100",
|
target: "http://backend:8100",
|
||||||
|
|||||||
Reference in New Issue
Block a user