Reference
Caddy Reference
Directive overview for Queue, Scheduler, Pogo, and WebSocket.
Queue
pogo_queue is a global Caddy option.
Caddyfile
{
pogo_queue {
backend redis {
url {$POGO_REDIS_URL}
}
worker public/queue-worker.php
}
}
| Directive | Default | Description |
|---|---|---|
backend redis | redis | Durable Redis Streams backend. |
backend memory | none | Local demo backend only. |
worker | queue-worker.php | PHP worker script. |
queues | default | Comma or space separated queue names. |
concurrency | 1 | Number of queue reserve loops. |
worker_threads | concurrency | FrankenPHP worker thread count. |
max_payload_bytes | 1048576 | Maximum job payload size. |
visibility_timeout | 90s | Time before a pending job can be reclaimed. |
reserve_timeout | 1s | Blocking reserve timeout. |
shutdown_timeout | 30s | Grace period for queue loop shutdown. |
max_attempts | 3 | Attempts before failed stream/dead-letter behavior. |
Redis backend directives:
| Directive | Default | Description |
|---|---|---|
url | POGO_REDIS_URL | Redis URL. Required if env var is absent. |
key_prefix | pogo | Redis key prefix. |
group | default | Redis consumer group. |
consumer | hostname and process id | Base consumer name. |
tls | false | Enables TLS for Redis connection. |
Memory backend directives:
| Directive | Default | Description |
|---|---|---|
max_messages | 1000 | Maximum in-memory messages. |
max_total_bytes | 67108864 | Maximum total payload bytes. |
Scheduler
pogo_scheduler is a global Caddy option.
Caddyfile
{
pogo_scheduler {
command php artisan schedule:run
dir /var/www/html
timeout 5m
overlap allow
shutdown_grace 30s
}
}
| Directive | Default | Description |
|---|---|---|
command | php artisan schedule:run | Command and arguments. |
dir | empty | Optional working directory. |
timeout | 5m | Max duration per command run. |
overlap | allow | allow or skip. |
shutdown_grace | 30s | Grace period before cancelling active commands. |
Pogo
pogo is a global Caddy option.
Caddyfile
{
pogo {
pool default {
worker public/pogo-worker.php
num_threads 8
max_wait 30s
}
}
}
| Directive | Required | Description |
|---|---|---|
pool | Yes | Defines a named worker pool. A default pool is required. |
worker | Yes | PHP worker script for the pool. |
num_threads | No | FrankenPHP worker thread count. |
max_wait | No | Maximum SendMessage wait. Defaults to 30s. |
WebSocket
pogo_websocket is an HTTP handler directive. Place it before php_server for the WebSocket route.
Caddyfile
route /app/* {
pogo_websocket {
app_id pogo-app
app_secret {$WS_APP_SECRET}
auth_path /pogo/auth
auth_script public/websocket-worker.php
}
}
Required directives:
| Directive | Description |
|---|---|
app_id | Pusher app id / key. |
app_secret | Shared secret. May be resolved from WS_APP_SECRET_<APP_ID> or WS_APP_SECRET. |
auth_path | Auth endpoint path. |
auth_script | PHP auth worker script. |
Common optional directives:
| Directive | Default | Description |
|---|---|---|
num_workers | 2 | Dedicated PHP auth workers. |
max_connections | 10000 | Max concurrent clients. |
max_auth_body | 16384 | Max PHP auth response body size. |
max_concurrent_auth | 100 | Auth concurrency guard. |
num_shards | CPU based | Internal hub shard count. |
handshake_rate | 100 | Connection attempts per second per direct remote IP. |
handshake_burst | 50 | Handshake burst allowance. |
allowed_origins | same host policy | Exact http:// or https:// origins. |
broker_queue_size | delivery default | Internal broker queue size. |
shard_queue_size | delivery default | Per-shard queue size. |
outbound_queue_size | delivery default | Per-client outbound queue size. |
write_burst_size | delivery default | Per-client write burst size. |
client_msg_rate_limit | module default | Client event rate limit. |
client_msg_rate_burst | module default | Client event burst. |
enable_compression | false | WebSocket compression. |
ping_period | module default | Server ping interval. |
pong_wait | module default | Client pong timeout. |
write_wait | module default | Socket write timeout. |
shutdown_timeout | module default | Graceful shutdown timeout. |
webhook_url | empty | Best-effort webhook target. |
webhook_secret | empty | Webhook signing secret. |
redis_host | empty | Enables Redis Pub/Sub broker. |
redis_password | empty | Redis password. |
redis_db | 0 | Redis database. |
redis_tls | false | Redis TLS. |