update_site
Rewrite an existing site's proxy_pass to a new upstream host and port in place, leaving SSL/certbot config untouched. Fails safely if no existing config or proxy_pass exists, and rolls back automatically if nginx -t fails.
Instructions
Update an existing site's upstream by rewriting its proxy_pass directive(s) in place - everything else in the config, including any SSL server block issue_cert/certbot added, is left untouched. Fails if the domain has no existing config (use create_site instead) or has no proxy_pass directive to update. Test-renders before keeping the change and rolls back automatically if nginx -t fails. Does NOT reload nginx - call reload_nginx afterward.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| domain | Yes | Domain of the existing site to update | |
| upstream_host | Yes | New hostname or IP nginx should proxy_pass to | |
| upstream_port | Yes | New TCP port on the upstream host |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| success | Yes | ||
| test_output | Yes | Output of `nginx -t` against the rewritten config, or an explanatory message if nothing was changed | |
| reload_required | Yes | True on success - nginx has not actually been reloaded yet |