fix(config): 更新AI代理配置为本地Ollama服务
- 将AI代理目标从远程服务器改为本地127.0.1:11434 - 更新Nginx配置中的代理地址和Host头部设置 - 修改AI_API_URL默认值指向本地Ollama服务 - 调整AI视图组件中的基础URL配置逻辑 - 更新环境变量示例文件中的默认API地址 - 修正Vite开发服务器代理配置指向本地服务
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
|
||||
项目已在 `vite.config.ts` 配置(默认目标可通过 `AI_PROXY_TARGET` 调整):
|
||||
|
||||
- `/ai-proxy/*` -> `https://ai-api.websoft.top/api/v1/*`
|
||||
- `/ai-proxy/*` -> `http://127.0.0.1:11434/api/v1/*`
|
||||
|
||||
配合 `.env.development`:
|
||||
|
||||
@@ -20,7 +20,7 @@ VITE_AI_API_URL=/ai-proxy
|
||||
|
||||
```nginx
|
||||
location /ai-proxy/ {
|
||||
proxy_pass https://ai-api.websoft.top/api/v1/;
|
||||
proxy_pass http://127.0.0.1:11434/api/v1/;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Host ai-api.websoft.top;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
@@ -48,9 +48,9 @@ VITE_AI_API_URL=/ai-proxy
|
||||
|
||||
```nginx
|
||||
location /proxy/ {
|
||||
proxy_pass http://47.119.165.234:11434/;
|
||||
proxy_pass http://127.0.0.1:11434/;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Host 47.119.165.234;
|
||||
proxy_set_header Host 127.0.0.1;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
|
||||
Reference in New Issue
Block a user