agentleFS
jholhewresjholhewres/devclaw-skills/skills/nginx/SKILL.md

nginx

Skill4 starsChanged 9 months agoMITView on GitHub

Nginx configuration, reverse proxy, and SSL

  • Installs packages

We split this skill into the rules it gives an agent

2 rules. 0 are common, 0 are distinctive, and 2 are very specific to this project.

  • 0

    Common

    Most of the 9 edited versions we read keep these.

  • 0

    Distinctive

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Always: run nginx -t before reload/restart

    line 117
  2. Very specific:

    Use sites-available + symlink to sites-enabled

    line 118

“Common” is measured: kept by at least 6 in 10 of the 9 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Nginx

Nginx management: configuration, reverse proxy, SSL.

Setup

# Check if installed
command -v nginx

# Install — macOS
brew install nginx

# Install — Ubuntu/Debian
sudo apt install nginx

Basic Commands

# Test configuration (ALWAYS before reload)
sudo nginx -t

# Reload (applies config without downtime)
sudo systemctl reload nginx

# Restart
sudo systemctl restart nginx

# Status
systemctl status nginx

# Version and modules
nginx -V

Logs

# Access log
sudo tail -f /var/log/nginx/access.log
sudo tail -100 /var/log/nginx/access.log

# Error log
sudo tail -f /var/log/nginx/error.log

# Logs for a specific site (if configured)
sudo tail -f /var/log/nginx/<site>-access.log

Site Configuration

# List sites
ls /etc/nginx/sites-available/
ls /etc/nginx/sites-enabled/

# Enable site
sudo ln -s /etc/nginx/sites-available/<site> /etc/nginx/sites-enabled/
sudo nginx -t && sudo systemctl reload nginx

# Disable site
sudo rm /etc/nginx/sites-enabled/<site>
sudo nginx -t && sudo systemctl reload nginx

Reverse Proxy (template)

server {
    listen 80;
    server_name example.com;

    location / {
        proxy_pass http://localhost:3000;
        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;
    }
}

SSL with Certbot

# Install certbot
sudo apt install certbot python3-certbot-nginx

# Get certificate (modifies nginx config automatically)
sudo certbot --nginx -d example.com

# Renew
sudo certbot renew --dry-run
sudo certbot renew

WebSocket Proxy

location /ws {
    proxy_pass http://localhost:8080;
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "upgrade";
    proxy_set_header Host $host;
}

Tips

  • Always run nginx -t before reload/restart
  • Use sites-available + symlink to sites-enabled
  • For debug: error_log /var/log/nginx/debug.log debug;
  • Rate limiting: limit_req_zone in the http section
  • Gzip: enable in /etc/nginx/nginx.conf for performance

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

Reviews can't be read right now.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.