Reference

Caddy Reference

Directive overview for Queue, Scheduler, Pogo, Upload, and WebSocket.

Queue

pogo_queue is a global Caddy option.

Caddyfile
{
  pogo_queue {
    backend redis {
      url {$POGO_REDIS_URL}
    }

    worker public/queue-worker.php
  }
}
DirectiveDefaultDescription
backend redisredisDurable Redis Streams backend.
backend memorynoneLocal demo backend only.
workerqueue-worker.phpPHP worker script.
queuesdefaultComma or space separated queue names.
concurrency1Number of queue reserve loops.
worker_threadsconcurrencyFrankenPHP worker thread count.
max_payload_bytes1048576Maximum job payload size.
visibility_timeout90sTime before a pending job can be reclaimed.
reserve_timeout1sBlocking reserve timeout.
shutdown_timeout30sGrace period for queue loop shutdown.
max_attempts3Attempts before failed stream/dead-letter behavior.

Redis backend directives:

DirectiveDefaultDescription
urlPOGO_REDIS_URLRedis URL. Required if env var is absent.
key_prefixpogoRedis key prefix.
groupdefaultRedis consumer group.
consumerhostname and process idBase consumer name.
tlsfalseEnables TLS for Redis connection.

Memory backend directives:

DirectiveDefaultDescription
max_messages1000Maximum in-memory messages.
max_total_bytes67108864Maximum 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
  }
}
DirectiveDefaultDescription
commandphp artisan schedule:runCommand and arguments.
diremptyOptional working directory.
timeout5mMax duration per command run.
overlapallowallow or skip.
shutdown_grace30sGrace period before cancelling active commands.

Pogo

pogo is a global Caddy option.

Caddyfile
{
  pogo {
    worker public/pogo-worker.php
    num_threads 8
    max_wait 30s

    pool external_api {
      worker public/pogo-worker.php
      num_threads 16
      max_wait 10s
    }
  }
}
DirectiveRequiredDescription
poolNoDefines a named worker pool. The top-level worker config is the required default pool.
workerYesPHP worker script for the default pool or named pool.
num_threadsNoFrankenPHP worker thread count.
max_waitNoMaximum SendMessage wait. Defaults to 30s.

Upload

pogo_upload is both a global Caddy option and an HTTP handler directive.

Caddyfile
{
  pogo_upload {
    store default {
      worker public/upload-worker.php
      signing_secret {$POGO_UPLOAD_SECRET}

      backend local {
        root storage/app/pogo-uploads
      }
    }
  }
}

handle /_pogo/upload/* {
  pogo_upload default
}

Store directives:

DirectiveDefaultDescription
workernoneRequired PHP worker script for completion and failure events.
signing_secretnoneRequired HMAC secret for upload URLs.
backend locallocalv1 storage backend.
rootnoneRequired local backend root directory.
token_ttl15mDefault signed URL lifetime.
max_upload_bytes1073741824Store-level upload limit.
max_concurrency32Max in-flight uploads for the store.
read_timeout30sMax idle read time while receiving the body.
complete_timeout10sMax wait for the PHP completion worker.
progress_ttl10mFinished progress record lifetime.

Handler argument:

ArgumentDefaultDescription
storedefaultConfigured store that owns the signed URL.

WebSocket

pogo_websocket is an HTTP handler directive. Place it before php_server for the WebSocket route.

Caddyfile
route /app/* {
  pogo_websocket {
    app_id {$REVERB_APP_ID}
    app_key {$REVERB_APP_KEY}
    app_secret {$REVERB_APP_SECRET}
  }
}

Required directives:

DirectiveDescription
app_idReverb/Pusher app id. May be resolved from REVERB_APP_ID.
app_keyPublic Reverb/Pusher app key. May be resolved from REVERB_APP_KEY.
app_secretShared secret. May be resolved from REVERB_APP_SECRET.

Common optional directives:

DirectiveDefaultDescription
num_workers2Dedicated PHP auth workers.
auth_pathemptyAuth endpoint path. Defaults to /broadcasting/auth when auth_script is set.
auth_scriptemptyOptional PHP auth fallback worker script. Required if auth_path is configured.
max_connections10000Max concurrent clients.
max_auth_body16384Max PHP auth response body size.
max_concurrent_auth100Auth concurrency guard.
num_shardsCPU basedInternal hub shard count.
handshake_rate100Connection attempts per second per direct remote IP.
handshake_burst50Handshake burst allowance.
allowed_originsallow all*, exact http:// or https:// origins, or host-only values.
broker_queue_sizedelivery defaultInternal broker queue size.
shard_queue_sizedelivery defaultPer-shard queue size.
outbound_queue_sizedelivery defaultPer-client outbound queue size.
write_burst_sizedelivery defaultPer-client write burst size.
client_msg_rate_limitmodule defaultClient event rate limit.
client_msg_rate_burstmodule defaultClient event burst.
enable_compressionfalseWebSocket compression.
ping_periodmodule defaultServer ping interval.
pong_waitmodule defaultClient pong timeout.
write_waitmodule defaultSocket write timeout.
shutdown_timeoutmodule defaultGraceful shutdown timeout.
webhook_urlemptyBest-effort webhook target.
webhook_secretemptyWebhook signing secret.
redis_hostemptyEnables Redis Pub/Sub broker.
redis_passwordemptyRedis password.
redis_db0Redis database.
redis_tlsfalseRedis TLS.