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
With this configuration, dstack-gateway listens port `9008` for incoming TLS connections and forwards them to the appropriate Tapp based on `SNI`, where SNI represents your custom domain and the forwarding destination is determined by your DNS records.
230
+
dstack-gateway listens for incoming TLS connections and forwards them to the appropriate app based on `SNI`. If the SNI is your custom domain, dstack-gateway queries the TXT DNS record `_dstack-app-address.<custom_domain>` to determine the forwarding destination.
237
231
238
232
For example, assuming I've deployed an app at `3327603e03f5bd1f830812ca4a789277fc31f577`, as shown below:
239
233
240
234

241
235
242
-
Now, I want to use my custom domain `tapp-nginx.kvin.wang` to access the Tapp. I need to set up two DNS records with my DNS provider (Cloudflare in my case):
236
+
Now, I want to use my custom domain `myapp.kvin.wang` to access the app. I need to set up two DNS records with my DNS provider (Cloudflare in my case):
243
237
244
238
1. `A` or `CNAME` record to point the domain to the tdx machine:
245
239
246
-

240
+

247
241
248
-
2. `TXT` record to instruct the dstack-gateway to direct the request to the specified Tapp:
242
+
2. `TXT` record to instruct the dstack-gateway to direct the request to the specified app:
249
243
250
-

244
+

251
245
252
246
Where
253
247
254
-
`_dstack-app-address.tapp-nginx.kvin.wang`means configuring the tapp destination address of domain `tapp-nginx.kvin.wang`.
248
+
`_dstack-app-address.myapp.kvin.wang`means configuring the app destination address of domain `myapp.kvin.wang`.
255
249
256
-
The TXT record value `3327603e03f5bd1f830812ca4a789277fc31f577:8043` means that requests sent to `tapp-nginx.kvin.wang` will be processed by Tapp `3327603e03f5bd1f830812ca4a789277fc31f577` on port `8043`
250
+
The TXT record value `3327603e03f5bd1f830812ca4a789277fc31f577:8043` means that requests sent to `myapp.kvin.wang` will be processed by app `3327603e03f5bd1f830812ca4a789277fc31f577` on port `8043`
257
251
258
-
Given the config `GATEWAY_LISTEN_PORT_PASSTHROUGH=9008`, now we can go to [`https://tapp-nginx.kvin.wang:9008`](https://tapp-nginx.kvin.wang:9008) and the request will be handled by the service listening on `8043` in Tapp `3327603e03f5bd1f830812ca4a789277fc31f577`.
252
+
Now we can go to [`https://myapp.kvin.wang`](https://myapp.kvin.wang) and the request will be handled by the service listening on `8043` in app `3327603e03f5bd1f830812ca4a789277fc31f577`.
0 commit comments