update: optimize environment

This commit is contained in:
tao.chen
2026-07-28 11:32:06 +08:00
parent ab731bdc3b
commit af74f2f242
4 changed files with 47 additions and 3 deletions
+2 -1
View File
@@ -134,6 +134,7 @@ async def verify_jupyter_access(
target_port = ws_info.get("port")
jupyter_token = ws_info.get("token")
jupyter_base_url = ws_info.get("base_url")
if not target_port:
raise HTTPException(
@@ -141,6 +142,6 @@ async def verify_jupyter_access(
)
# 通过 Response Header 返回 Upstream 地址与 Token 给 Nginx
response.headers["x-upstream-addr"] = f"http://192.168.139.3:{target_port}"
response.headers["x-upstream-addr"] = f"{jupyter_base_url}:{target_port}"
response.headers["x-jupyter-internal-token"] = jupyter_token or ""
return {"status": "ok"}