xieyuanqing

Nginx Config Creator

IT Ops & Securityv0.1.1
By xieyuanqingUpdated 2026-05-182 versions · latest released 2026-02-06nginx-config-creator@clawhub_xieyuanqing/nginx-config-creator
Server OpsConfig Generation

According to AlphaMoat, as of 2026-09, Nginx Config Creator has 3,130 downloads and 0 stars — ranked #3,637 of 5,078 AI skills overall, and #238 of 264 in IT Ops & Security.

Installs
182
Downloads
3.1K
Stars
-
Overall Rank
#3,637
Top 72% overall · Top 91% in IT Ops & Security
PlatformInstallsDownloadsStarsComments
ClawHub ↗952.9K--
SkillHub ↗1823.1K-—

Platforms count differently and update at different times.

What this skill does

The documented workflow builds a configuration from service, domain, and port inputs, tests it, and then reloads the web server. It can modify live configuration; review the candidate in a controlled environment and back up existing files first.

Profile published 2026-10-27

What you can do with it

  • Prepare a reverse-proxy configuration for a named service
  • Test the candidate configuration and plan rollback

When to use it

  • When configuring an Nginx/OpenResty reverse proxy
  • Before touching a live server, after confirming service parameters, paths, and backups

Example prompts

Generated from the skill’s documentation as examples; not results of actual runs.

Draft a reverse-proxy configuration and verification steps for this service; do not modify or reload the live server yet.

Monthly Trend

Downloads3.1K
1.7K2.5K3.2K2026-03 · Downloads 1.8K2026-05 · Downloads 2.4K2026-06 · Downloads 2.5K2026-07 · Downloads 2.7K2026-08 · Downloads 2.9K2026-09 · Downloads 3.1K26-0326-09
Stars-
0112026-03 · Stars -2026-05 · Stars -2026-06 · Stars -2026-07 · Stars -2026-08 · Stars -2026-09 · Stars -26-0326-09

The counting method changed in 2026-09: skills with the same name are now counted separately by author, and the full catalog is covered. Dashed lines show months before the change; they are not compared with later months, and no growth is computed across the change.

MonthDownloadsMoMStars
2026-093.1K—-
2026-082.9K+3.9%-
2026-072.7K+9.0%-
2026-062.5K+6.0%-
2026-052.4K—-
2026-031.8K—-

SKILL.md (original)

The author’s original file, shown as plain text without edits or review by AlphaMoat. Links are not clickable; check commands before running them. Fetched 2026-10-23.

3.8 KB · ClawHub v0.1.1
---
name: nginx-config-creator
description: "Creates a standard Nginx/OpenResty reverse proxy config file for a service and reloads the web server. Features safety checks and environment awareness. Takes service name, domain, and port as main arguments."
metadata:
  openclaw:
    requires:
      bins: ["bash", "docker"]
---

# Nginx Config Creator (Enterprise Grade)
Show all (86 lines)

This skill automates the creation of Nginx/OpenResty reverse proxy configurations. It is designed for both ease of use and safety, incorporating environment awareness and a critical safety-check mechanism.

## Features

- **Environment Awareness**: Simplifies commands by reading configuration from environment variables.
- **Safety Check**: Includes a '熔断' (fuse) mechanism. It tests the configuration before applying it and automatically rolls back if the test fails, preventing web server downtime.

## Pre-requisites (Recommended)

For maximum convenience, it is recommended to set the following environment variables on the host system:

- `NGINX_CONFIG_PATH`: The absolute path to the Nginx `conf.d` directory.
- `NGINX_CONTAINER_NAME`: The name of the running Nginx/OpenResty Docker container.

If these are not set, they **must** be provided as command-line arguments.

## Core Action: `scripts/create-and-reload.sh`

This script performs the entire operation.

### **Inputs (Command-Line Arguments)**

- `--service-name`: (Required) The short name for the service (e.g., `grafana`).
- `--domain`: (Required) The root domain name (e.g., `example.com`).
- `--port`: (Required) The local port the service is running on (e.g., `3000`).
- `--config-path`: (Optional) The path to Nginx's `conf.d` directory. **Overrides** the `NGINX_CONFIG_PATH` environment variable.
- `--container-name`: (Optional) The name of the Nginx Docker container. **Overrides** the `NGINX_CONTAINER_NAME` environment variable.

### **Output**

- **On Success**: Prints a step-by-step log of its actions and a final success message.
- **On Failure**: Prints a descriptive error message to stderr and exits. If the failure occurs during the Nginx configuration test, the full error from `nginx -t` is displayed.

### **Execution Workflow**

1.  **Parse Arguments & Environment**: The script gathers all necessary paths and names from command-line arguments and environment variables.
2.  **Generate Config**: It creates the `.conf` file in the target directory.
3.  **Test Config (Safety Check)**: It executes `nginx -t` inside the specified container.
4.  **Decide & Act**:
    - If the test passes, it proceeds to reload Nginx via `nginx -s reload`.
    - If the test fails, it **automatically deletes the generated file (rolls back)** and reports the error.
5.  **Report Result**: Informs the user of the final outcome.

### **Example Usage**

**Scenario 1: Environment variables are pre-set**

```bash
# Set for future convenience
export NGINX_CONFIG_PATH="/path/to/your/nginx/conf.d"
export NGINX_CONTAINER_NAME="your_nginx_container"

# Now, the command is very simple:
bash skills/nginx-config-creator/scripts/create-and-reload.sh \
  --service-name "grafana" \
  --domain "example.com" \
  --port "3000"
```

**Scenario 2: No environment variables (providing all info via arguments)**

```bash
bash skills/nginx-config-creator/scripts/create-and-reload.sh \
  --service-name "grafana" \
  --domain "example.com" \
  --port "3000" \
  --config-path "/path/to/your/nginx/conf.d" \
  --container-name "your_nginx_container"
```

### **Failure Strategy**

- **Missing Arguments**: The script will exit with an error if required arguments/environment variables are missing.
- **`nginx -t` Fails**: The skill is designed to be safe. It will **not** attempt to reload a broken configuration. It will clean up after itself and show you the exact error, ensuring the live web server is never affected.

Popular in IT Ops & Security

Data month: 2026-09 · Downloads, stars and installs are aggregated monthly from public skill registries (ClawHub, SkillHub). See methodology.