Files
nexus/wiki/concepts/CORS-Allowlist.md
2026-05-03 05:42:12 +08:00

949 B
Raw Blame History

title, type, tags, sources, last_updated
title type tags sources last_updated
CORS-Allowlist concept
expose-hermes-agent-as-an-openai-compatible-api-for-any-frontend
2026-05-02

Definition

CORS Allowlist跨域资源共享白名单是一种浏览器安全机制通过精确配置允许特定来源的跨域请求。

Purpose

当浏览器中的前端应用(如 Open WebUI调用不同域的后端 API 时浏览器会先发送预检请求OPTIONS服务器需明确允许该来源才能放行。

Configuration in Hermes Agent

Hermes Agent API Server 支持 CORS Allowlist 配置:

  • 环境变量CORS_ALLOWED_ORIGINS 设置允许的域名列表
  • 默认值:仅允许配置列表中的来源
  • 安全建议:生产环境仅开放必要的域名

Example

CORS_ALLOWED_ORIGINS=https://app.openwebui.com,https://chat.example.com