diff --git a/deploy/prod/nginx.conf.tmpl b/deploy/prod/nginx.conf.tmpl index 1c1c077f5e87bd1e9fcfb927addc2969ac1d954b..0c07e8b863c761bf4e4a62a91571755e3207dcc1 100644 --- a/deploy/prod/nginx.conf.tmpl +++ b/deploy/prod/nginx.conf.tmpl @@ -87,7 +87,7 @@ http { expires 30d; } - location / { + location /witchaind { proxy_set_header X-Real-IP $remote_addr; root /usr/share/nginx/html; try_files $uri $uri/ /index.html; @@ -96,12 +96,12 @@ http { } } - location /api/health_check { + location /witchaind/api/health_check { deny all; return 404; } - location /api/ { + location /witchaind/api/ { proxy_set_header X-Real-IP $remote_addr; add_header X-XSS-Protection "1; mode=block"; add_header X-Frame-Options DENY; @@ -126,11 +126,11 @@ http { error_page 404 /404.html; error_page 500 501 502 503 504 505 /error.html; - location = /404.html { + location = /witchaind/404.html { root /usr/share/nginx/html; } - location = /error.html { + location = /witchaind/error.html { root /usr/share/nginx/html; } } diff --git a/src/utils/request.ts b/src/utils/request.ts index 9051b10451d72bda46da00429b280a208bdd5ee6..88a9f5bad0849506928038527f2356fc9402652a 100644 --- a/src/utils/request.ts +++ b/src/utils/request.ts @@ -8,7 +8,7 @@ import { IconError } from "@computing/opendesign-icons"; // 创建 axios 实例 const service = axios.create({ - baseURL: "/api", + baseURL: "/witchaind/api", timeout: 90000, withCredentials: true, headers: { diff --git a/vite.config.ts b/vite.config.ts index 55bf8e9745edf94ffccb7b0b79e420fb9236993e..958853b5421b278502c8e52d9638080869ad9f78 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -58,11 +58,11 @@ export default defineConfig(({ mode }: ConfigEnv): UserConfig => { }, open: true, proxy: { - "/api": { + "/witchaind/api": { target: "http://116.63.144.61:9988", changeOrigin: true, ws: false, - rewrite: (path) => path.replace(new RegExp("^" + "/api"), ""), + rewrite: (path) => path.replace(new RegExp("^" + "/witchaind/api"), ""), }, }, },