create_site
Create a new nginx server block for a domain, proxying to a given upstream host and port. It validates with nginx -t before applying and rolls back on failure, preparing the site for reload and SSL.
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.
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 | |
| reload_required | Yes | True on success - nginx has not actually been reloaded yet |