generate_nginx_vhost
Create nginx virtual host configuration files for Webasyst projects by specifying domain, root path, and PHP version to deploy applications.
Instructions
Сгенерировать nginx-конфиг
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| domain | Yes | ||
| root_path | Yes | ||
| php_version | No |
Implementation Reference
- webasyst-mcp.js:1351-1372 (handler)The handler function that implements the generate_nginx_vhost tool. It generates an Nginx vhost configuration file with a server block listening on port 80, configured for PHP-FPM, and saves it as {domain}.nginx.conf in the current directory.async function generateNginxVhostTool({ domain, root_path, php_version = '8.2' }) { const vhost = `server { listen 80; server_name ${domain}; root ${root_path}; index index.php; location / { try_files $uri $uri/ /index.php?$query_string; } location ~ \\.php$ { fastcgi_pass unix:/var/run/php/php${php_version}-fpm.sock; include fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; } } `; const file = path.join(process.cwd(), `${domain}.nginx.conf`); await fs.writeFile(file, vhost); return { content: [{ type: 'text', text: `Nginx vhost создан: ${file}` }] }; }
- webasyst-mcp.js:1745-1747 (registration)Registration of the 'generate_nginx_vhost' tool in the MCP server's tools list, including its description and input schema definition.{ name: 'generate_nginx_vhost', description: 'Сгенерировать nginx-конфиг', inputSchema: { type: 'object', properties: { domain: { type: 'string' }, root_path: { type: 'string' }, php_version: { type: 'string' } }, required: ['domain', 'root_path'] } }, { name: 'generate_htaccess', description: 'Сгенерировать .htaccess', inputSchema: { type: 'object', properties: { root_path: { type: 'string' } }, required: ['root_path'] } },
- webasyst-mcp.js:1807-1807 (registration)The switch case in the CallToolRequestSchema handler that routes calls to the generateNginxVhostTool function.case 'generate_nginx_vhost': return await generateNginxVhostTool(args);
- webasyst-mcp.js:1745-1747 (schema)Input schema for the generate_nginx_vhost tool, defining required parameters: domain and root_path, optional php_version.{ name: 'generate_nginx_vhost', description: 'Сгенерировать nginx-конфиг', inputSchema: { type: 'object', properties: { domain: { type: 'string' }, root_path: { type: 'string' }, php_version: { type: 'string' } }, required: ['domain', 'root_path'] } }, { name: 'generate_htaccess', description: 'Сгенерировать .htaccess', inputSchema: { type: 'object', properties: { root_path: { type: 'string' } }, required: ['root_path'] } },