Normalizes non-standard code-fence language tags across `docs/**` so a strict highlighter (Shiki, used by Fumadocs) won't fail the build on an unrecognized language, and unifies redundant synonym tags onto one canonical form per language. The current renderer (Speed-Highlight) detects the language from the code content, not the fence label, so this drift wasn't visible until now. ## Changes - `hcl` -> `tf` (199 fences, including indented ones nested in numbered/bulleted lists). Shiki ships `hcl` and `terraform` as two distinct grammars (not aliases); every `hcl`-tagged fence in `docs/**` is actually Terraform resource/data/provider syntax, so the more specific `terraform` grammar is correct for all of them. `tf` is Shiki's own alias for that grammar, and it's also what GitHub's own markdown renderer resolves to the same HCL/Terraform highlighting. - `pwsh`/`powershell` -> `ps1`. Both `ps` and `ps1` are registered PowerShell aliases in Shiki, but on GitHub's renderer only `.ps1` is a registered file extension (`.ps` isn't), so `ps1` renders identically to `powershell` there today while bare `ps` would silently lose highlighting. - `env` -> `dotenv` (a dedicated Shiki grammar for `KEY=VALUE` files) - `text`/`output`/`none`/`url` -> `txt`. Same built-in plain-text fallback either way, just shorter. - `Dockerfile` -> `dockerfile` (lowercase) - `bash`/`shell` -> `sh` (732 fences). Shiki and GitHub both alias all three to a single shell grammar; this was already the style guide's stated preference, just not enforced across the existing corpus until now. - `markdown` -> `md` (4 fences). Alias of the same grammar in both Shiki and GitHub. - `jsonc` -> `json` (1 fence). The block has no comments or trailing commas, so it doesn't need the comments-capable grammar. - `ts` -> `tsx` (2 fences, `docs/about/contributing/frontend.md`). Verified the actual content tokenizes identically under both grammars, and a sibling block in the same file already needs `tsx` for real JSX, so unifying to one tag is safe for this file. Documented a caveat: `tsx` mis-tokenizes the legacy angle-bracket type-assertion syntax (`<Type>value`), which is invalid in real `.tsx` files anyway, so use `value as Type` instead. - `yml` -> `yaml` (1 fence) - Updated `docs/.style/style-guide/formatting.md` to document all canonical tags `promql` (2 fences) and `caddyfile` (2 fences) are left as-is. Shiki doesn't bundle a grammar for either, so they need a custom grammar registration when the site adopts Shiki, rather than degrading to `txt`. Tracked as follow-up work under DOCS-118 and [DOCS-544](https://linear.app/codercom/issue/DOCS-544/vendor-a-local-promql-grammar-for-shiki-syntax-highlighting) (promql). Does not touch `offlinedocs/`. Linear: [DOCS-476](https://linear.app/codercom/issue/DOCS-476/normalize-docs-code-fence-languages-de-risk-shikifumadocs) <details> <summary>How the fence tags were verified</summary> Each tag was tested against a real `shiki@latest` highlighter instance (`codeToHtml`/`codeToTokens`) and cross-checked against GitHub's `@wooorm/starry-night` grammar sources (the renderer that actually displays these `.md` files today, in repo browsing and PR diffs), since that's what determines whether brevity is safe before Shiki adoption: ```text FAIL env -- Language `env` is not included in this bundle. FAIL Dockerfile -- Language `Dockerfile` is not included in this bundle. FAIL promql -- Language `promql` is not included in this bundle. FAIL caddyfile -- Language `caddyfile` is not included in this bundle. FAIL pwsh -- Language `pwsh` is not included in this bundle. FAIL output -- Language `output` is not included in this bundle. ``` `hcl` doesn't error in Shiki, since it's a real grammar, but that's exactly the trap: it was silently rendering every fence with the generic HCL grammar instead of the Terraform-specific one. Every `hcl`-tagged fence in `docs/**` was manually checked against `origin/main` and is genuinely Terraform content. For `ts`/`tsx`, tokenizing the actual doc content confirmed identical output under both grammars; a synthetic test with the legacy angle-bracket cast syntax confirmed `tsx` degrades on that specific construct, which the style guide now calls out. The first normalization pass only matched fence tags at column 0 (`^```tag$`), missing tags indented inside numbered/bulleted lists. A follow-up pass caught the remaining occurrences at any indentation level. </details> --- *This PR description and the underlying changes were prepared with Coder Agents assistance.*
5.6 KiB
Wildcard Access URLs
Wildcard access URLs unlock Coder's full potential for modern development workflows. While optional for basic SSH usage, this feature becomes essential when teams need web applications, development previews, or browser-based tools. Wildcard access URLs are essential for many development workflows in Coder - Web IDEs (code-server, VS Code Web, JupyterLab) and some development frameworks work significantly better with subdomain-based access rather than path-based URLs.
Why configure wildcard access URLs?
Key benefits
- Enables port access: Each application gets a unique subdomain with port support (e.g.
8080--main--myworkspace--john.coder.example.com). - Enhanced security: Applications run in isolated subdomains with separate browser security contexts and prevents access to the Coder API from malicious JavaScript
- Better compatibility: Most applications are designed to work at the root of a hostname rather than at a subpath, making subdomain access more reliable
Applications that require subdomain access
The following tools require wildcard access URL:
- Vite dev server: Hot module replacement and asset serving issues with path-based routing
- React dev server: Similar issues with hot reloading and absolute path references
- Next.js development server: Asset serving and routing conflicts with path-based access
- JupyterLab: More complex template configuration and security risks when using path-based routing
- RStudio: More complex template configuration and security risks when using path-based routing
Configuration
CODER_WILDCARD_ACCESS_URL is necessary for port forwarding via the dashboard or running coder_apps on an absolute path. Set this to a wildcard subdomain that resolves to Coder (e.g. *.coder.example.com).
export CODER_WILDCARD_ACCESS_URL="*.coder.example.com"
coder server
TLS Certificate Setup
Wildcard access URLs require a TLS certificate that covers the wildcard domain. You have several options:
Tip
You can use a single certificate for both the access URL and wildcard access URL. The certificate CN or SANs must match the wildcard domain, such as
*.coder.example.com.
Direct TLS Configuration
Configure Coder to handle TLS directly using the wildcard certificate:
export CODER_TLS_ENABLE=true
export CODER_TLS_CERT_FILE=/path/to/wildcard.crt
export CODER_TLS_KEY_FILE=/path/to/wildcard.key
See TLS & Reverse Proxy for detailed configuration options.
Reverse Proxy with Let's Encrypt
Use a reverse proxy to handle TLS termination with automatic certificate management:
If your reverse proxy rewrites the request Host and forwards the original
host in X-Forwarded-Host, configure
CODER_PROXY_TRUSTED_ORIGINS
to trust that proxy's address. Otherwise Coder will ignore X-Forwarded-Host
for subdomain app routing.
DNS Setup
You'll need to configure DNS to point wildcard subdomains to your Coder server:
Note
We do not recommend using a top-level-domain for Coder wildcard access (for example
*.workspaces), even on private networks with split-DNS. Some browsers consider these "public" domains and will refuse Coder's cookies, which are vital to the proper operation of this feature.
*.coder.example.com A <your-coder-server-ip>
Or alternatively, using a CNAME record:
*.coder.example.com CNAME coder.example.com
Workspace Proxies
If you're using workspace proxies for geo-distributed teams, each proxy requires its own wildcard access URL configuration:
# Main Coder server
export CODER_WILDCARD_ACCESS_URL="*.coder.example.com"
# Sydney workspace proxy
export CODER_WILDCARD_ACCESS_URL="*.sydney.coder.example.com"
# London workspace proxy
export CODER_WILDCARD_ACCESS_URL="*.london.coder.example.com"
Each proxy's wildcard domain must have corresponding DNS records:
*.sydney.coder.example.com A <sydney-proxy-ip>
*.london.coder.example.com A <london-proxy-ip>
Template Configuration
In your Coder templates, enable subdomain applications using the subdomain parameter:
resource "coder_app" "code-server" {
agent_id = coder_agent.main.id
slug = "code-server"
display_name = "VS Code"
url = "http://localhost:8080"
icon = "/icon/code.svg"
subdomain = true
share = "owner"
}
Troubleshooting
Applications not accessible
If workspace applications are not working:
-
Verify the
CODER_WILDCARD_ACCESS_URLenvironment variable is configured correctly:- Check the deployment settings in the Coder dashboard (Settings > Deployment)
- Ensure it matches your wildcard domain (e.g.,
*.coder.example.com) - Restart the Coder server if you made changes to the environment variable
-
Check DNS resolution for wildcard subdomains:
dig test.coder.example.com nslookup test.coder.example.com -
Ensure TLS certificates cover the wildcard domain
-
Confirm template
coder_appresources havesubdomain = true
See also
- Workspace Proxies - Improve performance for geo-distributed teams using wildcard URLs