First, understand a few things:
-
Every identity has a unique did (distributed identifier) that looks like this:
did:plc:cbkjy5n7bk3ax2wplmtjofq2
-
You can alias a domain to your did.
dig +short TXT _atproto.ngerakines.me "did=did:plc:cbkjy5n7bk3ax2wplmtjofq2"
This is a standard setup where you have a base domain with users as subdomains.
First, run the PDS with the following configuration:
PDS_HOSTNAME=cauda.cloud
Second, run the reverse proxy with the following configuration:
{
email your_email_address
on_demand_tls {
ask http://127.0.0.1:3000/tls-check
}
}
*.cauda.cloud, cauda.cloud {
reverse_proxy 127.0.0.1:3000
tls {
on_demand
}
}
Additionally, if you want to setup a site on www.cauda.cloud
, you can configure that in caddy.
www.cauda.cloud {
root * /opt/cauda-cloud/www
file_server
log {
output file /var/log/caddy/www-cauda-cloud.log
}
}
*.cauda.cloud, cauda.cloud {
@towww {
not path /xrpc/*
not path /.well-known/*
}
redir @towww https://www.cauda.cloud{uri}
reverse_proxy 127.0.0.1:3000
tls {
on_demand
}
log {
output file /var/log/caddy/cauda-cloud.log
}
}
The above matchers in caddy would proxy all ^/xrpc/.*$
requests to pds, and then any other requests to the bare domain are redirected to the www subdomain.