web-next: 域名通道 allowedHosts 登记(sms.unimsc.com/sms.i7l.cn)——nginx(192.168.5.20) 443 根路径反代→5174 的 Host 头放行(vite5.4+ DNS-rebinding 防护默认仅 localhost/内网 IP,口径同 web/vite.config.ts d8a77f12);HMR 不设 clientPort 同源端口直连(教训留痕:clientPort:443 曾致内网直连 HMR 失败循环刷新,域名通道 wss 待 nginx 上线再评估)
This commit is contained in:
@@ -15,6 +15,13 @@ export default defineConfig(() => {
|
|||||||
server: {
|
server: {
|
||||||
host: '0.0.0.0',
|
host: '0.0.0.0',
|
||||||
port: 5174,
|
port: 5174,
|
||||||
|
// sms.unimsc.com 外网域名通道(2026-11-17 需求:入口由旧 web :5173 切至 web-next :5174):
|
||||||
|
// 经 nginx(192.168.5.20) 根路径反代(443→5174)访问,Host 头为域名;
|
||||||
|
// vite5.4+ DNS-rebinding 防护默认只放行 localhost/内网 IP,须显式登记(口径同 web/vite.config.ts)。
|
||||||
|
allowedHosts: ['sms.unimsc.com', 'sms.i7l.cn'],
|
||||||
|
// HMR:不设 clientPort——同源端口直连(内网 http://ip:5174 → ws://ip:5174)。
|
||||||
|
// 教训(2026-11-17):clientPort:443 曾致内网直连 HMR 连向 :443 失败循环刷新;
|
||||||
|
// 域名通道 HMR 需 nginx 443 上线后再评估(届时走 wss 同源 443,勿再用 clientPort 硬编码)。
|
||||||
proxy: {
|
proxy: {
|
||||||
'/api': {
|
'/api': {
|
||||||
target: process.env.VITE_DEV_PROXY_TARGET || 'http://localhost:8080',
|
target: process.env.VITE_DEV_PROXY_TARGET || 'http://localhost:8080',
|
||||||
|
|||||||
Reference in New Issue
Block a user