AgentSkillsCN

zeabur-domain-url

当服务需要公开 URL 以实现重定向或跨域资源共享(CORS)时,可选用此功能。若 WEB_URL 或类似配置项末尾存在多余的斜杠问题,也可选用此功能。

SKILL.md
--- frontmatter
name: zeabur-domain-url
description: Use when services need public URL for redirects or CORS. Use when WEB_URL or similar has trailing slash issues.

Zeabur Domain URL Configuration

Symptom

  • Redirects go to wrong URL (missing domain suffix, or has trailing slash)
  • CORS errors due to URL mismatch
  • ${ZEABUR_WEB_URL} has trailing slash causing path issues

System Variables

VariableExampleNote
ZEABUR_WEB_URLhttps://app.zeabur.app/Has trailing slash
ZEABUR_WEB_DOMAINapp.zeabur.appDomain only, no protocol

Solution

Expose URL from entry service to others:

yaml
- name: entry-service
  domainKey: PUBLIC_DOMAIN
  spec:
    env:
      APP_URL:
        default: https://${ZEABUR_WEB_DOMAIN}
        expose: true

- name: backend
  spec:
    env:
      WEB_URL:
        default: ${APP_URL}

Use https://${ZEABUR_WEB_DOMAIN} not ${ZEABUR_WEB_URL} to avoid trailing slash.