GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — dstack-ingress: new optional SAN field on certs by Garandor · Pull Request #86 · Dstack-TEE/dstack-examples

Conversation

@Garandor

@Garandor Garandor commented Mar 23, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Adds ALIAS_DOMAIN environment variable support to dstack-ingress. When set:

  • certbot issues a SAN certificate covering both DOMAIN and ALIAS_DOMAIN (via --expand -d)
  • nginx server_name includes ALIAS_DOMAIN so requests arriving via either hostname are accepted

This change is DNS-provider agnostic.

This PR was scoped down from #83
Thanks to the original author @wwwehr !

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@Garandor
support SAN on certs. scoped down from upstream Dstack-TEE#83
b6fb468
@cl4wb0t cl4wb0t mentioned this pull request Mar 23, 2026
feat: add ALIAS_DOMAIN / SAN support for all DNS providers cl4wb0t/dstack-examples#3
Closed
4 tasks
Garandor added 2 commits March 23, 2026 15:34
@Garandor
fix indentation
aeefd4d
@Garandor
fmt fix
31d959b
@Garandor

Garandor commented Mar 23, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Author

for future discussion: We may want to prevent traffic that arrives on the per-node domain from being accepted to prevent people from circumventing an external load balancer.

A followup PR may be needed to (optionally) let nginx only accept on the ALIAS_DOMAIN.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

h4x3rotab
h4x3rotab approved these changes Mar 23, 2026
View reviewed changes

@h4x3rotab h4x3rotab left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks for the contribution!

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@Garandor Garandor mentioned this pull request Mar 23, 2026
feat: add dstack-ingress for custom domain TLS (CPL-118) LIT-Protocol/chipotle#153
Closed
1 of 3 tasks
kvinwang
kvinwang reviewed Mar 27, 2026
View reviewed changes

@kvinwang kvinwang left a comment

Copy link
Copy Markdown
Collaborator

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the clean PR! A couple of notes:

  1. DNS records for ALIAS_DOMAIN: The main DOMAIN gets automatic CNAME/TXT record setup, but ALIAS_DOMAIN is only added to the certificate and nginx server_name — there's no DNS management for it. It would be helpful to document that users need to ensure ALIAS_DOMAIN resolves to the same endpoint themselves.

  2. Conflict with #88: Heads up — #88 replaces nginx with HAProxy and rewrites the entrypoint and nginx config generation that this PR touches. If #88 lands first, this will need to be rebased and adapted to the new HAProxy setup.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread custom-domain/dstack-ingress/README.md
- `PROXY_BUFFERS`: Optional value for nginx `proxy_buffers` (format: `number size`, e.g. `4 256k`) in single-domain mode
- `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
- `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)
- `ALIAS_DOMAIN`: An additional domain to include as a Subject Alternative Name (SAN) on the TLS certificate and in nginx `server_name`. When set, the node's certificate covers both `DOMAIN` and `ALIAS_DOMAIN`, and nginx will accept requests for either hostname.

@kvinwang kvinwang Mar 27, 2026

Copy link
Copy Markdown
Collaborator

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Worth mentioning that ALIAS_DOMAIN only affects the certificate and nginx server_name — users are responsible for setting up DNS records (e.g. CNAME) for the alias domain to point to the same endpoint. Without this, the alias domain won't actually be reachable.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
kvinwang
kvinwang reviewed Mar 27, 2026
View reviewed changes

@kvinwang kvinwang left a comment

Copy link
Copy Markdown
Collaborator

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few more things after reading through the full certificate management flow:

  1. DNS-01 validation requires same DNS provider: certbot needs to create _acme-challenge TXT records for both DOMAIN and ALIAS_DOMAIN. If the alias domain is managed by a different DNS provider or account, the DNS-01 challenge will fail silently. The PR description says "DNS-provider agnostic" but this isn't quite accurate — both domains must be manageable by the same provider credentials. This should be documented as a prerequisite.

  2. Multi-domain mode: ALIAS_DOMAIN is silently ignored when using DOMAINS env var, since each domain goes through process_domain → renew-certificate.sh independently and only certman.py's certonly path reads ALIAS_DOMAIN. Worth thinking about how this should interact with multi-domain mode — perhaps ALIAS_DOMAIN should be rejected (with an error) when DOMAINS is set, or generalized into a per-domain alias mapping.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
kvinwang
kvinwang reviewed Mar 27, 2026
View reviewed changes

@kvinwang kvinwang left a comment

Copy link
Copy Markdown
Collaborator

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One more thought — could this use case be served by the existing multi-domain mode instead of introducing a new ALIAS_DOMAIN mechanism?

The idea: add both domains to DOMAINS and point them to the same backend. Each domain gets its own certificate, automatic DNS record management (CNAME/TXT), and full evidence chain coverage — which ALIAS_DOMAIN currently lacks.

Current approach (nginx, on main branch):

Add both domains to DOMAINS and provide per-domain nginx configs via docker configs, both proxy_pass-ing to the same backend:

services:
  ingress:
    image: dstacktee/dstack-ingress:...
    environment:
      DOMAINS: |
        primary.example.com
        alias.example.com
    configs:
      - source: primary_conf
        target: /etc/nginx/conf.d/primary.conf
      - source: alias_conf
        target: /etc/nginx/conf.d/alias.conf
  app:
    image: your-app

configs:
  primary_conf:
    content: |
      server {
          listen 443 ssl;
          server_name primary.example.com;
          ssl_certificate /etc/letsencrypt/live/primary.example.com/fullchain.pem;
          ssl_certificate_key /etc/letsencrypt/live/primary.example.com/privkey.pem;
          location / { proxy_pass http://app:80; }
      }
  alias_conf:
    content: |
      server {
          listen 443 ssl;
          server_name alias.example.com;
          ssl_certificate /etc/letsencrypt/live/alias.example.com/fullchain.pem;
          ssl_certificate_key /etc/letsencrypt/live/alias.example.com/privkey.pem;
          location / { proxy_pass http://app:80; }
      }

With #88 (HAProxy L4 proxy):

Much simpler — just use ROUTING_MAP to point both domains to the same backend:

services:
  ingress:
    image: dstacktee/dstack-ingress:...
    environment:
      DOMAINS: |
        primary.example.com
        alias.example.com
      ROUTING_MAP: |
        primary.example.com=app:80
        alias.example.com=app:80
  app:
    image: your-app

The multi-domain approach has advantages over ALIAS_DOMAIN:

  • DNS records (CNAME, TXT) are automatically managed for both domains
  • Both domains' certificates are included in the evidence/attestation chain
  • No new code needed

The only trade-off is two separate LE certs instead of one SAN cert, but that has no practical impact since LE certs are free and auto-renewed.

What do you think? Is there a specific reason a single SAN certificate is needed here?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
This was referenced Jul 28, 2026
dstack-ingress: follow-ups after the delegation (#104) and tls-alpn-01 (#105) merges #106
Open
fix(dstack-ingress): verify delegated records with dnsguide, not a second checker #107
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@kvinwang kvinwang kvinwang left review comments
@h4x3rotab h4x3rotab h4x3rotab approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@Garandor @h4x3rotab @kvinwang
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.