site_configuration_update
Update nginx, Apache, and PHP config for a site. Auto-validates with nginx -t and reverts on failure when SSH is configured. Supports partial updates by fetching current values for omitted blocks.
Instructions
Replace the nginx (frontend), apache (backend) and php.ini config for a site. DANGEROUS: invalid syntax can take down the site or the whole nginx/apache service. SAFETY NET: when SSH is configured (FASTPANEL_SSH_HOST) and validate:true (the default), the tool runs nginx -t right after applying and AUTO-REVERTS to the previous config if it fails, so a bad edit can't leave nginx unable to reload. Without SSH there is NO validation — preview with dry_run and double-check by hand. ⚠️ SIDE EFFECT — manual mode: the first config update flips the site to manual_changes=true on the panel side. After that, FastPanel STOPS managing this site's config: it will no longer auto-insert the 443 server block, the HTTP→HTTPS redirect, or Let's Encrypt renewal/acme-challenge locations when you issue or renew SSL. You become responsible for the full HTTPS block (including ssl_certificate paths — get them from certificates_list crt_path/key_path). Partial update IS supported here (unlike the raw API): omit any of frontend/backend/phpini and the tool fetches the current value via site_configuration_get and sends it back unchanged, so you can safely change just one block. Endpoint: PUT /api/sites/{site_id}/configuration. WRITE — confirm:true required.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| phpini | No | Full php.ini overrides for this site. Omit to keep current. | |
| backend | No | Full apache/httpd config for this site (VirtualHost block). Omit to keep current. | |
| confirm | No | ||
| dry_run | No | ||
| site_id | Yes | Site id from sites_list | |
| frontend | No | Full nginx config for this site (HTTPS server block + HTTP redirect block). Omit to keep current. | |
| validate | No | When SSH is configured (FASTPANEL_SSH_HOST), run `nginx -t` right after applying and AUTO-REVERT to the previous config if it fails. Set false to skip the check (no effect if SSH is unconfigured — there is no validation either way then). |