# Reverb WebSocket configuration for Apache
# Adjust the paths to your colibriplus storage logs and the reverb server host and port.

# Upgrade WebSocket connections on /app to the Reverb server
RewriteCond %{HTTP:Upgrade} websocket [NC]
RewriteCond %{HTTP:Connection} upgrade [NC]
RewriteRule ^/app(.*) ws://127.0.0.1:13000/app$1 [P,L]

# --- Logging (Apache equivalent) ---
# Access log
# You can also disable the access log by commenting out the CustomLog line.
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
CustomLog /path/to/your/colibriplus/storage/logs/colibriplus_reverb_access.log combined env=websocket_or_app

# Error log (debug level for WebSocket issues)
ErrorLog /path/to/your/colibriplus/storage/logs/colibriplus_reverb_error.log
LogLevel debug

# --- Required headers for Laravel Reverb ---
RequestHeader set X-Forwarded-Proto "https"
RequestHeader set X-Forwarded-For %{REMOTE_ADDR}e
