Skip to content

🤯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.

📝 docs(self-hosting): add OAuth token exchange troubleshooting for Docker reverse proxy (#11240)

YuTengjinged811c51f89f
diff --git a/docs/self-hosting/server-database/docker-compose.mdx b/docs/self-hosting/server-database/docker-compose.mdx
index cab0178b695..3ab28d30908 100644
--- a/docs/self-hosting/server-database/docker-compose.mdx
+++ b/docs/self-hosting/server-database/docker-compose.mdx
@@ -440,6 +440,17 @@ Solutions:
- A straightforward troubleshooting method is to use the `curl` command in the LobeChat container terminal to access your authentication service at `https://auth.example.com/.well-known/openid-configuration`. If JSON format data is returned, it indicates your authentication service is functioning correctly.
+#### OAuth Token Exchange Failures with Reverse Proxy
+
+If OAuth authentication fails during the token exchange phase when using Docker behind a reverse proxy, this is typically caused by the default `MIDDLEWARE_REWRITE_THROUGH_LOCAL=1` setting which rewrites URLs to `127.0.0.1:3210`.
+
+**Solution**: Set `MIDDLEWARE_REWRITE_THROUGH_LOCAL=0` in your `.env` file and restart Docker containers:
+
+```bash
+docker compose down
+docker compose up -d
+```
+
````markdown
## Extended Configuration
diff --git a/docs/self-hosting/server-database/docker-compose.zh-CN.mdx b/docs/self-hosting/server-database/docker-compose.zh-CN.mdx
index d2e0c47db79..010d55a3213 100644
--- a/docs/self-hosting/server-database/docker-compose.zh-CN.mdx
+++ b/docs/self-hosting/server-database/docker-compose.zh-CN.mdx
@@ -421,6 +421,17 @@ lobe-chat | [auth][error] TypeError: fetch failed
- 一个直接的排查方式,你可以在 LobeChat 容器的终端中,使用 `curl` 命令访问你的鉴权服务 `https://auth.example.com/.well-known/openid-configuration`,如果返回了 JSON 格式的数据,则说明你的鉴权服务正常运行。
+#### 反向代理下 OAuth 令牌交换失败
+
+如果在反向代理后使用 Docker 时 OAuth 认证在令牌交换阶段失败,这通常是由默认的 `MIDDLEWARE_REWRITE_THROUGH_LOCAL=1` 设置引起的,该设置会将 URL 重写为 `127.0.0.1:3210`。
+
+**解决方案**: 在 `.env` 文件中设置 `MIDDLEWARE_REWRITE_THROUGH_LOCAL=0` 并重启 Docker 容器:
+
+```bash
+docker compose down
+docker compose up -d
+```
+
## 拓展配置
为了完善你的 LobeChat 服务,你可以根据你的需求进行以下拓展配置。
diff --git a/packages/model-bank/src/aiModels/lobehub.ts b/packages/model-bank/src/aiModels/lobehub.ts
index bb9238ca88e..9903d00461c 100644
--- a/packages/model-bank/src/aiModels/lobehub.ts
+++ b/packages/model-bank/src/aiModels/lobehub.ts
@@ -860,6 +860,34 @@ const lobehubChatModels: AIChatModelCard[] = [
releasedAt: '2025-08-26',
type: 'chat',
},
+ {
+ abilities: {
+ functionCall: true,
+ reasoning: true,
+ search: true,
+ vision: true,
+ },
+ contextWindowTokens: 256_000,
+ description:
+ 'Our newest and strongest flagship model, excelling in NLP, math, and reasoning—an ideal all-rounder.',
+ displayName: 'Grok 4',
+ enabled: true,
+ id: 'grok-4',
+ pricing: {
+ units: [
+ { name: 'textInput_cacheRead', rate: 0.75, strategy: 'fixed', unit: 'millionTokens' },
+ { name: 'textInput', rate: 3, strategy: 'fixed', unit: 'millionTokens' },
+ { name: 'textOutput', rate: 15, strategy: 'fixed', unit: 'millionTokens' },
+ ],
+ },
+ releasedAt: '2025-07-09',
+ settings: {
+ // reasoning_effort is not supported by grok-4. Specifying reasoning_effort parameter will get an error response.
+ // extendParams: ['reasoningEffort'],
+ searchImpl: 'params',
+ },
+ type: 'chat',
+ },
{
abilities: {
imageOutput: true,