site_backend_update
Update an existing site's backend settings including PHP version, handler, port, and environment variables by providing the site ID.
Instructions
Update backend settings of an existing site: PHP version, handler (php_fpm/fcgi), app file, port, socket path, env vars. Pass the SITE id (from sites_list) — this tool resolves the backend id internally (the API endpoint is PUT /api/sites/backend/{backend_id}, where backend_id = main_backend.id, NOT the site id; passing a site id there 404s). All settings except site_id are optional: omitted fields keep the site's current backend values (fetched via site_get). NOTE: this does NOT change the site's document root (site.index_dir) — nginx renders root from the site object, not the backend. Use site_update for docroot. WRITE — confirm:true required.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"site_id": "<site_id>"
},
"name": "site_backend_update"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| port | No | Backend listen port (default: keep current) | |
| type | No | Backend runtime type (default: keep current) | |
| confirm | No | ||
| dry_run | No | ||
| handler | No | PHP handler (only meaningful for type=php; default: keep current) | |
| site_id | Yes | Site id from sites_list (backend id is resolved automatically) | |
| app_file | No | Entry file (default: keep current) | |
| work_dir | No | Working directory (default: keep current) | |
| environment | No | Env vars, e.g. ['KEY=val'] (default: keep current) | |
| socket_path | No | Unix socket path for the backend (default: keep current) | |
| manual_changes | No | Preserve manual changes to backend config | |
| handler_version | No | PHP version without dot (default: keep current) |