You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-`CERTBOT_EMAIL` - Email for Let's Encrypt registration
19
19
-`TARGET_ENDPOINT` - Backend application endpoint to proxy to
20
-
-`DNS_PROVIDER` - DNS provider to use (`cloudflare`, `linode`, `namecheap`)
20
+
-`DNS_PROVIDER` - DNS provider to use (`cloudflare`, `linode`, `namecheap`, `route53`)
21
21
22
22
### Optional Variables
23
23
24
24
-`SET_CAA` - Enable CAA record setup (default: false)
25
25
-`PORT` - HTTPS port (default: 443)
26
26
-`TXT_PREFIX` - Prefix for TXT records (default: "_tapp-address")
27
+
-`ALIAS_DOMAIN` - Public-facing domain shared across multiple nodes (e.g., `app.example.com`). Added as a SAN on the TLS certificate and to nginx `server_name`. When set alongside `ROUTE53_INITIAL_WEIGHT` (Route53 only), also creates a weight-0 weighted CNAME `ALIAS_DOMAIN → DOMAIN` to register this node in the pool without routing traffic to it. See [Weighted Routing with ALIAS_DOMAIN](#weighted-routing-with-alias_domain-route53).
27
28
28
29
## Provider-Specific Configuration
29
30
@@ -104,11 +105,12 @@ PolicyDocument:
104
105
```
105
106
106
107
**Optional Variables for Route53:**
107
-
- `ROUTE53_INITIAL_WEIGHT` - Enables [Weighted Routing](https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/routing-policy-weighted.html) on the CNAME record created for your domain. Set to an integer (e.g., `100`) to assign that weight to the record. A unique `SetIdentifier` is generated automatically. TXT records (used for Certbot DNS challenges) are never weighted. Omit this variable to create a standard non-weighted CNAME record.
108
+
- `ROUTE53_INITIAL_WEIGHT` - Enables [Weighted Routing](https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/routing-policy-weighted.html) on the CNAME record created for `DOMAIN` (e.g. `node1.app.example.com → phala gateway`). Set to an integer (e.g., `100`) to assign that weight to the record. A unique `SetIdentifier` is generated automatically. TXT records are never weighted. Omit to create a standard non-weighted CNAME. When `ALIAS_DOMAIN` is also set, this variable additionally triggers creation of a weight-0 weighted CNAME `ALIAS_DOMAIN → DOMAIN` — see below.
109
+
- `ALIAS_DOMAIN`- See [Weighted Routing with ALIAS_DOMAIN](#weighted-routing-with-alias_domain-route53).
108
110
109
111
**Important Notes for Route53:**
110
-
- The certbot plugin uses the format `certbot-dns-route53` package
111
-
- CAA will merge AWS & Let's Encrypt CA domains to existing records if they exist
112
+
- The certbot plugin uses the `certbot-dns-route53` package
113
+
- CAA will merge AWS & Let's Encrypt CA domains into existing records if they exist
112
114
- It is essential that the AWS service account used can only assume the limited role. See cloudformation example.
113
115
114
116
## Docker Compose Examples
@@ -165,22 +167,22 @@ services:
165
167
- ./evidences:/evidences
166
168
```
167
169
168
-
### Route53 Example
170
+
### Route53 Example (single node, no weighted routing)
For multi-node weighted routing, see [Weighted Routing with ALIAS_DOMAIN](#weighted-routing-with-alias_domain-route53).
200
+
201
+
## Weighted Routing with ALIAS_DOMAIN (Route53)
202
+
203
+
This pattern lets you run multiple independent TEE nodes behind a single public domain using Route53 weighted routing. Each node manages its own Phala identity (TXT record, CNAME to gateway) while also being registered as a weighted target for the shared public domain.
4. Obtain TLS cert for node2.app.example.com + app.example.com (SAN)
194
244
```
195
245
246
+
The node is fully verified and ready before step 3 introduces it to the pool. Traffic only starts flowing after an operator explicitly sets the weight above 0 in Route53.
247
+
248
+
### Docker Compose Example (weighted, two-node setup)
Node 2 (`node2.app.example.com`) uses identical config with `DOMAIN: node2.app.example.com`. On first boot it registers itself at weight 0. To promote it, update the record weight in Route53.
281
+
282
+
### Important Notes
283
+
284
+
- The weight-0 CNAME for `ALIAS_DOMAIN` uses `DOMAIN` as the `SetIdentifier`, so each node has a stable, unique slot in the weighted record set that survives restarts without creating duplicates.
285
+
- For non-Route53 providers (Cloudflare, Linode, Namecheap), `ALIAS_DOMAIN` still adds the SAN and updates nginx, but those providers do not support weighted CNAME records at the DNS level. You would need to manage traffic distribution through the provider's own load balancing features.
286
+
-`ALIAS_DOMAIN` must be in the same Route53 hosted zone as `DOMAIN`, or at least a zone your credentials can write to.
287
+
196
288
## Migration from Cloudflare-only Setup
197
289
198
290
If you're currently using the Cloudflare-only version:
Copy file name to clipboardExpand all lines: custom-domain/dstack-ingress/README.md
+63Lines changed: 63 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -184,6 +184,7 @@ configs:
184
184
- `PROXY_BUFFERS`: Optional value for nginx `proxy_buffers` (format: `number size`, e.g. `4 256k`) in single-domain mode
185
185
- `PROXY_BUSY_BUFFERS_SIZE`: Optional value for nginx `proxy_busy_buffers_size` (numeric with optional `k|m` suffix, e.g. `256k`) in single-domain mode
186
186
- `CERTBOT_STAGING`: Optional; set this value to the string `true` to set the `--staging` server option on the [`certbot` cli](https://eff-certbot.readthedocs.io/en/stable/using.html#certbot-command-line-options)
187
+
- `ALIAS_DOMAIN`: Optional; a single public-facing domain shared across multiple nodes (e.g. `app.example.com`). Added as a SAN on the TLS certificate and to nginx `server_name`. When combined with `ROUTE53_INITIAL_WEIGHT` (Route53 only), also registers a weight-0 weighted CNAME `ALIAS_DOMAIN → DOMAIN` so the node is in the pool but dark until promoted. See [Multi-Node Weighted Routing](#multi-node-weighted-routing-with-alias_domain).
187
188
188
189
**Backward Compatibility:**
189
190
@@ -252,6 +253,68 @@ volumes:
252
253
cert-data:
253
254
```
254
255
256
+
## Multi-Node Weighted Routing with ALIAS_DOMAIN
257
+
258
+
`ALIAS_DOMAIN`enables a pattern where multiple independent TEE nodes share a single public-facing domain via DNS weighted routing, while each node maintains its own Phala-verified identity.
259
+
260
+
### How It Works
261
+
262
+
Each node has a **node domain** (`DOMAIN`, e.g. `node1.app.example.com`) that is the primary identity used for Phala's TXT-based app routing. A single **public domain** (`ALIAS_DOMAIN`, e.g. `app.example.com`) is shared across all nodes and used as the user-facing address.
1. **Certificate** — issues a SAN cert covering both `DOMAIN` and `ALIAS_DOMAIN`, so nginx can serve TLS regardless of which hostname the client connected through.
290
+
2. **Nginx** — adds `ALIAS_DOMAIN` to `server_name` so requests arriving via the public domain are accepted.
291
+
3. **Weighted CNAME** *(Route53 only, requires `ROUTE53_INITIAL_WEIGHT`)* — creates a weighted CNAME record `ALIAS_DOMAIN → DOMAIN` at **weight 0**, registering this node in the pool without routing any traffic to it yet. The `SetIdentifier` is set to `DOMAIN` so each node occupies a unique, stable slot.
The node is fully provisioned and verified before receiving any user traffic. Traffic is enabled by a deliberate operator action (bumping the weight in Route53), not automatically.
308
+
309
+
### Configuration
310
+
311
+
| Variable | Required | Description |
312
+
|---|---|---|
313
+
| `ALIAS_DOMAIN` | No | Public-facing domain shared across nodes (e.g. `app.example.com`) |
314
+
| `ROUTE53_INITIAL_WEIGHT` | No | Weight for this node's primary CNAME. When combined with `ALIAS_DOMAIN`, also triggers creation of the weight-0 CNAME for the public domain. |
315
+
316
+
See [DNS Provider Configuration](DNS_PROVIDERS.md#weighted-routing-with-alias_domain-route53) for a full example.
317
+
255
318
## Domain Attestation and Verification
256
319
257
320
The dstack-ingress system provides mechanisms to verify and attest that your custom domain endpoint is secure and properly configured. This comprehensive verification approach ensures the integrity and authenticity of your application.
0 commit comments