> ## Documentation Index
> Fetch the complete documentation index at: https://docs.azvian.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Custom domains

> Serve a status page from your own address, such as status.example.com

A status page can be served from your own address instead of `/status/your-page` on the main install. Three things have to line up. The first two are done in the app and at your DNS provider; the third is done once by whoever runs the server.

1. **Prove you own the domain** (in the app, plus one DNS record).
2. **Point the domain at this server** (DNS).
3. **Let the web server accept the domain and get a certificate for it** (server setup).

## 1. In the app

Open **Status pages → Edit** on the page, enter the domain under *Custom domain* and save. The page then shows a TXT record to add:

| Type | Name | Value |
| - | - | - |
| TXT | `_azvian-verify.status.example.com` | `azvian-verify=…` |

Add it at your DNS provider and press **Verify domain**. DNS can take a few minutes to spread, so if the first try fails, wait and press it again.

The record is there so that nobody can claim a domain they do not control. Only a verified domain is ever served, and only one page can hold a given domain. You can delete the TXT record after verification; changing the domain later means verifying again.

## 2. DNS

Create a `CNAME` from `status.example.com` to the address this install runs on (the host in `APP_URL`), or an `A` record to the server's IP.

If you use Cloudflare, either leave the record "DNS only", or keep the proxy on and set SSL mode to *Full (strict)*.

## 3. Web server and certificate

The server must answer for the new hostname and have a valid certificate for it. Everything the visitor sees on that host is the status page; the admin app, login and every other URL return 404 there.

> [tab] Caddy (recommended)
>
> Certificates are automatic. Caddy fetches one the first time a domain is requested, as long as the app confirms the domain is real. That check is the `/domain-check` endpoint: it answers `204` for a verified domain with a public page and `404` for anything else, so Caddy cannot be talked into requesting certificates for arbitrary names.
>
> ```caddyfile theme={null}
> {
>     on_demand_tls {
>         ask http://127.0.0.1:8080/domain-check
>     }
> }
>
> # the install itself
> status-admin.example.com {
>     root * /var/www/uptime-monitor/public
>     php_fastcgi unix//run/php/php8.3-fpm.sock
>     file_server
> }
>
> # every custom domain
> https:// {
>     tls {
>         on_demand
>     }
>     root * /var/www/uptime-monitor/public
>     php_fastcgi unix//run/php/php8.3-fpm.sock
>     file_server
> }
> ```
>
> Adjust the `ask` address to wherever the app answers locally. Set `APP_URL` to the install's own address (`https://status-admin.example.com`) so the app knows which host is its own.

> [tab] nginx
>
> Add a `server` block per domain (or one catch-all `server_name _;`) that serves the same `public/` directory and the same PHP-FPM socket as the main site, and issue a certificate for each domain, for example with `certbot --nginx -d status.example.com`. Unlike Caddy, nginx does not do this automatically.

> [tab] Shared hosting / cPanel
>
> Add the domain as an *alias* (or parked domain) pointing at the same document root as the install, and enable AutoSSL for it.

## What is and is not served on a custom domain

| Path | Result |
| - | - |
| `/` | the status page |
| `/history` | the incident history |
| `/logo` | the page's logo |
| `/up` | the health check |
| anything else | `404` |

Visitors to a custom domain are never given a session cookie.

## Troubleshooting

* **"Not verified yet: no TXT record found."** The record is not visible to the server yet. Check the name carefully: many DNS providers want only `_azvian-verify.status` (without the domain) in the *Name* field.
* **Verified, but the browser shows the main app or an error.** DNS or the web server is not pointing at this install yet (steps 2 and 3).
* **Certificate errors on a new domain with Caddy.** Check that `curl 'http://127.0.0.1:8080/domain-check?domain=status.example.com'` returns `204`. It will not until the domain is verified *and* the page is switched on.
* **The domain works but shows a 404.** The page is switched off. Tick *Public* on the page.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.