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

# Configuration Reference

> Configuration Reference — CometChat documentation.

Use this reference when updating domains, migrating environments, troubleshooting misconfiguration, or performing production deployments. Values are sourced from `docker-compose.yml`, service-level `.env` files, and the domain update guide.

Use this when:

* Updating domains
* Migrating environments
* Troubleshooting service misconfiguration
* Performing production deployments

## Global notes

* All services read environment variables from their respective directories.
* Domain values must be updated consistently across API, WebSocket, Notifications, Webhooks, and NGINX configurations.
* Changing the primary domain impacts reverse proxy routing, OAuth headers, CORS, webhook endpoints, and TiDB host references.

## Chat API

Update these values when changing domains:

* `MAIN_DOMAIN="<your-domain>"`
* `EXTENSION_DOMAIN="<your-domain>"`
* `WEBHOOKS_BASE_URL="https://webhooks.<your-domain>/v1/webhooks"`
* `TRIGGERS_BASE_URL="https://webhooks.<your-domain>/v1/triggers"`
* `EXTENSION_BASE_URL="https://notifications.<your-domain>"`
* `MODERATION_ENABLED=true`
* `RULES_BASE_URL="https://moderation.<your-domain>/v1/moderation-service"`
* `ADMIN_API_HOST="api.<your-domain>"`
* `CLIENT_API_HOST="apiclient.<your-domain>"`
* `ALLOWED_API_DOMAINS="<your-domain>,<additional-domain>"`
* `DB_HOST="tidb.<your-domain>"`

## Management API (MGMT API)

* `ADMIN_API_HOST="api.<your-domain>"`
* `CLIENT_API_HOST="apiclient.<your-domain>"`
* `APP_HOST="dashboard.<your-domain>"`
* `API_HOST="https://mgmt-api.<your-domain>"`
* `MGMT_DOMAIN="<your-domain>"`
* `RULES_BASE_URL="https://moderation.<your-domain>/v1/moderation"`
* `ACCESS_CONTROL_ALLOW_ORIGIN="<your-domain>,<additional-domain>"`

## WebSocket

Hostnames are derived automatically from NGINX and Chat API configuration; no manual domain updates are required.

## Notifications service

* `CHAT_API_DOMAIN="<your-domain>"` (controls routing, token validation, and push delivery)

## Moderation service

* `CHAT_API_URL="<your-domain>"` for rule evaluation, metadata retrieval, and decision submission

## Webhooks service

* `CHAT_API_DOMAIN="<your-domain>"` - must match the Chat API domain exactly to avoid retries or signature verification failures

## Extensions

```json theme={null}
"DOMAINS": [
  "<allowed-domain-1>",
  "<allowed-domain-2>",
  "<your-domain>"
],
"DOMAIN_NAME": "<your-domain>"
```

Defines CORS and allowed origins for extension traffic.

## Receipt Service

* `RECEIPTS_MYSQL_HOST="tidb.<your-domain>"` for delivery receipts, read receipts, and thread metadata

## Data Sync Service

```json theme={null}
"CONNECTION_CONFIG": {
  "host": "<tidb-host>"
},
"ALTER_USER_CONFIG": {
  "host": "<tidb-host>"
},
"API_CONFIG": {
  "API_DOMAIN": "<api-domain>"
}
```

Controls database migrations, multi-tenant provisioning, and internal requests to Chat API.

## NGINX configuration files

Update domain values in:

* chatapi.conf
* extensions.conf
* mgmtapi.conf
* notifications.conf
* dashboard.conf
* globalwebhooks.conf
* moderation.conf
* websocket.conf

These govern TLS termination, routing, reverse proxy rules, and WebSocket upgrades.

## Summary of domain values to update

* Chat API, Client API, and Management API
* Notifications, Moderation, Webhooks, and Extensions services
* NGINX reverse proxy hostnames
* TiDB host references
* WebSocket host configuration in Chat API

Configuration changes should be tested in staging environments before production deployment. For assistance with complex multi-region setups, custom domain architectures, or migration planning, [contact us](https://www.cometchat.com/contact-sales).
