- 公网反代:Nginx 状态卡片(版本 / 运行状态 / 配置校验 / 端口监听) - 部署设置第一、二梯队(HTTPS 开关、安全头、限流、连接数、仅中国大陆 IP) - 隧道检测兼容 frps v0.68 / v0.71(V2 与旧版端点) - 恢复被清空的 internal/frp/store.go、internal/api/ddns_handler.go、web/src/views/DdnsView.vue
34 lines
866 B
TypeScript
34 lines
866 B
TypeScript
import { readFileSync } from 'node:fs'
|
|
import { defineConfig } from 'vite'
|
|
import vue from '@vitejs/plugin-vue'
|
|
|
|
const pkg = JSON.parse(readFileSync(new URL('./package.json', import.meta.url), 'utf-8')) as { version: string }
|
|
|
|
export default defineConfig({
|
|
plugins: [vue()],
|
|
define: {
|
|
__APP_VERSION__: JSON.stringify(process.env.VITE_APP_VERSION || pkg.version),
|
|
},
|
|
server: {
|
|
port: 5173,
|
|
allowedHosts: true,
|
|
proxy: {
|
|
'/api': {
|
|
target: 'http://localhost:6893',
|
|
configure(proxy) {
|
|
proxy.on('proxyRes', (proxyRes, req) => {
|
|
if (req.url?.includes('/stream')) {
|
|
proxyRes.headers['cache-control'] = 'no-cache'
|
|
proxyRes.headers['x-accel-buffering'] = 'no'
|
|
}
|
|
})
|
|
},
|
|
},
|
|
},
|
|
},
|
|
build: {
|
|
outDir: 'dist',
|
|
emptyOutDir: true,
|
|
},
|
|
})
|