DevOps v1.0.0

nginx-reverse-proxy

Configure nginx reverse proxy for domain binding. Trigger when user says "绑定域名" or "配置nginx" or "反向代理" to bind a domain...

cloudswave 更新于 2026-04-11 1 浏览
下载 SKILL

技能说明

Configure nginx reverse proxy for domain binding. Trigger when user says "绑定域名" or "配置nginx" or "反向代理" to bind a domain to a specific IP:port.

使用场景

When user requests to bind a domain to IP:port (e.g., "绑定域名 claw.nul.qzz.io 到 127.0.0.1:18789"), create nginx config:

查看英文原始说明

Configure nginx reverse proxy for domain binding. Trigger when user says "绑定域名" or "配置nginx" or "反向代理" to bind a domain to a specific IP:port.

直接复制以下提示词,发送给你的 AI 助手即可完成安装。

帮我下载并安装这个SKILL:https://skillhub.cstcloud.cn/download/nginx-reverse-proxy
  1. 点击上方「下载 SKILL」按钮,获取技能压缩包。
  2. 将压缩包解压到你的 Agent 技能目录。
  3. 重启客户端后即可在技能列表中选择该技能。

技能文件内容

4 个文件 · 21 kB
SKILL.md text/markdown
---
name: nginx-reverse-proxy
description: Configure nginx reverse proxy for domain binding. Trigger when user says "绑定域名" or "配置nginx" or "反向代理" to bind a domain to a specific IP:port.
---

# Nginx 反向代理配置

When user requests to bind a domain to IP:port (e.g., "绑定域名 claw.nul.qzz.io 到 127.0.0.1:18789"), create nginx config:

1. Extract domain (e.g., `claw.nul.qzz.io`) and target (e.g., `127.0.0.1:18789`)
2. Generate nginx config file at `/etc/nginx/conf.d/{domain}.conf`:

```nginx
server {
    listen 443 ssl;
    server_name {domain};

    ssl_certificate /etc/letsencrypt/live/{domain}/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/{domain}/privkey.pem;
    ssl_session_timeout 1d;
    ssl_session_cache shared:SSL:50m;
    ssl_protocols TLSv1.2 TLSv1.3;
    ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256;
    ssl_prefer_server_ciphers off;

    location / {
        proxy_pass http://{target};
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
    }
}
```

3. If HTTP (not HTTPS) needed:
```nginx
server {{
    listen 80;
    server_name {domain};
    location / {{
        proxy_pass http://{target};
        proxy_http_version 1.1;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
    }}
}}
```

4. Execute:
```bash
sudo tee /etc/nginx/conf.d/{domain}.conf > /dev/null <<'EOF'
<config>
EOF
sudo nginx -t && sudo systemctl reload nginx
```

5. If SSL needed, also run:
```bash
sudo certbot --nginx -d {domain}
```

6. Report success with domain and target info.

文件内容直接读取自技能仓库,仅供安装前审阅;以实际下载的压缩包为准。