zeabur-domain-url

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Zeabur Domain URL Configuration

Zeabur 域名URL配置

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
  • 重定向跳转至错误URL(缺少域名后缀,或带有尾部斜杠)
  • 因URL不匹配出现CORS错误
  • ${ZEABUR_WEB_URL}
    存在尾部斜杠导致路径问题

System Variables

系统变量

VariableExampleNote
ZEABUR_WEB_URL
https://app.zeabur.app/
Has trailing slash
ZEABUR_WEB_DOMAIN
app.zeabur.app
Domain only, no protocol
变量示例说明
ZEABUR_WEB_URL
https://app.zeabur.app/
带有尾部斜杠
ZEABUR_WEB_DOMAIN
app.zeabur.app
仅包含域名,无协议

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.
将入口服务的URL暴露给其他服务:
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}
请使用
https://${ZEABUR_WEB_DOMAIN}
而非
${ZEABUR_WEB_URL}
以避免尾部斜杠问题。