@maplezzk/llm-proxy 0.28.0 → 0.28.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +16 -0
  2. package/README.zh.md +16 -0
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -211,6 +211,22 @@ When `admin_key` is configured, management APIs require `Authorization: Bearer <
211
211
 
212
212
  The macOS App and Web UI keep their interface language preferences locally and no longer modify the server `locale`. The server locale controls server logs and backend messages only.
213
213
 
214
+ ### Reverse-proxy paths
215
+
216
+ The Web UI derives its reverse-proxy prefix from the current `/admin` page URL. For example, publishing the service below `/llm-proxy/` only requires ordinary Nginx path forwarding:
217
+
218
+ ```nginx
219
+ location /llm-proxy/ {
220
+ proxy_pass http://127.0.0.1:9000/;
221
+ proxy_set_header Host $host;
222
+ proxy_set_header X-Forwarded-Proto $scheme;
223
+ proxy_set_header Authorization $http_authorization;
224
+ proxy_buffering off;
225
+ }
226
+ ```
227
+
228
+ Do not use `sub_filter` to globally replace `/admin`. It also rewrites regular expressions inside the inline JavaScript bundle and causes a syntax error before the Web UI can start.
229
+
214
230
  ## Protocol Translation Matrix
215
231
 
216
232
  | Source | Target | Non-streaming | Streaming (SSE) |
package/README.zh.md CHANGED
@@ -197,6 +197,22 @@ llm-proxy status # 查看状态
197
197
 
198
198
  macOS App 与 Web UI 的界面语言分别保存在本机和当前浏览器,不再修改服务端 `locale`。服务端 `locale` 仅控制服务日志和后端消息语言。
199
199
 
200
+ ### 反向代理路径
201
+
202
+ Web UI 会根据当前 `/admin` 页面路径自动解析反向代理前缀。例如将服务发布到 `/llm-proxy/` 时,Nginx 只需正常转发路径:
203
+
204
+ ```nginx
205
+ location /llm-proxy/ {
206
+ proxy_pass http://127.0.0.1:9000/;
207
+ proxy_set_header Host $host;
208
+ proxy_set_header X-Forwarded-Proto $scheme;
209
+ proxy_set_header Authorization $http_authorization;
210
+ proxy_buffering off;
211
+ }
212
+ ```
213
+
214
+ 不要使用 `sub_filter` 全局替换 `/admin`。它会同时改写内联 JavaScript 的正则表达式,导致 Web UI 在加载时出现语法错误。
215
+
200
216
  ## 协议转换矩阵
201
217
 
202
218
  | 源 | 目标 | 非流式 | 流式 (SSE) |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@maplezzk/llm-proxy",
3
- "version": "0.28.0",
3
+ "version": "0.28.2",
4
4
  "description": "本地统一 LLM 模型代理工具 — 多协议路由、协议互转、流式 SSE 转换、token 统计、协议抓包调试",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",