refactor(proxy): 统一代理路径配置从 /ollama-proxy 到 /proxy

- 将 nginx 反向代理路径从 /ollama-proxy 修改为 /proxy
- 更新 .env.development 和 .env.example 中的 VITE_OLLAMA_API_URL 配置
- 修改 src/config/setting.ts 中的默认代理路径配置
- 更新 vite.config.ts 中的代理配置路径映射
- 优化代码格式化和多行语句的换行处理
- 调整打包配置中的文件命名逻辑格式
This commit is contained in:
2026-02-27 22:59:04 +08:00
parent b40326c3a9
commit b272ad09ce
5 changed files with 44 additions and 24 deletions

View File

@@ -47,7 +47,7 @@ VITE_AI_API_URL=/ai-proxy
如果你要直接用原生 Ollama`http://<host>:11434`),生产环境同样建议走同源反代(避免 CORS + https 混合内容):
```nginx
location /ollama-proxy/ {
location /proxy/ {
proxy_pass http://47.119.165.234:11434/;
proxy_http_version 1.1;
proxy_set_header Host 47.119.165.234;
@@ -63,7 +63,7 @@ location /ollama-proxy/ {
然后把 `VITE_OLLAMA_API_URL` 配置为:
```bash
VITE_OLLAMA_API_URL=/ollama-proxy
VITE_OLLAMA_API_URL=/proxy
```
## 3) 关于 API Key