zeabur-domain-url
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseZeabur Domain URL Configuration
Zeabur 域名URL配置
Symptom
问题现象
- Redirects go to wrong URL (missing domain suffix, or has trailing slash)
- CORS errors due to URL mismatch
- has trailing slash causing path issues
${ZEABUR_WEB_URL}
- 重定向跳转至错误URL(缺少域名后缀,或带有尾部斜杠)
- 因URL不匹配出现CORS错误
- 存在尾部斜杠导致路径问题
${ZEABUR_WEB_URL}
System Variables
系统变量
| Variable | Example | Note |
|---|---|---|
| | Has trailing slash |
| | Domain 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 not to avoid trailing slash.
https://${ZEABUR_WEB_DOMAIN}${ZEABUR_WEB_URL}将入口服务的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}