huaweicloud_sandbox_deploy_nginx
Deploy an nginx configuration on the sandbox and reload. Takes nginxType, port, project, outputDir from framework detection and writes the correct template (SPA try_files, SSR reverse proxy, or static). Also fixes directory traverse permissions on the project path. Use this instead of manually constructing nginx config — it handles permissions, template selection, and reload in one call.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| port | Yes | Listen port (from framework detection). | |
| project | Yes | Project directory name under /workspace, e.g. movie-ticket. | |
| username | No | Login username (default: root) | |
| node_port | No | Node.js app port for SSR (required when nginx_type=proxy). | |
| nginx_type | Yes | Nginx config type from framework detection: spa (try_files fallback for SPA/SSG/cross-platform), proxy (reverse proxy for SSR), or static (plain root for Hugo/Hexo). | |
| output_dir | Yes | Build output directory relative to /workspace/<project>, e.g. dist/build/h5. | |
| timeout_ms | No | Execution timeout in milliseconds (default: 30000) | |
| config_name | No | Config file name (without .conf suffix). Defaults to the project name, ensuring each project gets its own config. Override with distinct names (e.g. admin, docs) for sub-app deployments. | |
| public_port | No | Public listen port for SSR proxy (optional, defaults to port). | |
| workspace_id | No | Workspace ID from huaweicloud_sandbox_connect return value. Required - must be passed explicitly when HW_WORKSPACE_ID is not set. |