create_site
Creates a new nginx server block for a domain, proxying to a specified upstream host and port. Validates configuration with nginx -t before applying, with automatic rollback on failure.
Instructions
Create a new nginx server block from the websocket-capable default template. Validates and test-renders (nginx -t) before touching live config, and rolls back automatically if the test fails. Does NOT reload nginx or request a certificate - follow with reload_nginx to go live, then issue_cert to get SSL. To point an existing site at a different upstream later, use update_site instead of recreating it. If a config for the domain already exists it is replaced - after being backed up (see rollback_site).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| domain | Yes | Domain for the new server block, e.g. mysite.julcap.net | |
| upstream_host | Yes | Hostname or IP nginx should proxy_pass to | |
| upstream_port | Yes | TCP port on the upstream host |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| success | Yes | ||
| config_path | No | Present on success: absolute path of the written config | |
| test_output | Yes | Output of `nginx -t` against the rendered config | |
| backup_created | No | True if an existing config was replaced; it was backed up first (see rollback_site) | |
| reload_required | Yes | True on success - nginx has not actually been reloaded yet |