jmservera/aithena/nginx-reverse-proxy

Claude Code and agent skill by jmservera/aithena

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

nginx reverse proxy patterns for Docker Compose multi-service apps: routing, health checks, startup ordering, SSL overlay

Install

npx vskill@latest install jmservera/aithena/nginx-reverse-proxy

SKILL.md

The same SKILL.md was published earlier as jmservera/aithena/nginx-reverse-proxy.

Context

nginx is the single entry point for all aithena traffic. It reverse-proxies the React frontend, FastAPI backend, Solr admin, RabbitMQ management, Streamlit admin, and Redis Commander. Getting the configuration right is critical for zero-downtime startup and clean service isolation.

Pattern 1: Single Port Publisher

Rule: Only nginx publishes host ports. All other services use expose: only.

yaml
# docker-compose.yml
nginx:
ports:
- "80:80"
- "443:443" # only in ssl overlay
solr-search:
expose:
- "8080" # internal only — no host binding
solr1:
expose:
- "8983" # internal only

Why: Prevents port collisions (e.g., zoo1 admin-server on 8080 vs solr-search on 8080), simplifies firewall rules, and centralizes TLS termination.

Pattern 2: Health Endpoint

nginx includes a lightweight health endpoint for Docker health checks:

nginx
location /health {
access_log off;
return 200 "healthy\n";
add_header Content-Type text/plain;
}

Docker Compose health check:

yaml
nginx:
healthcheck:
test: ["CMD-SHELL", "curl -fsS http://localhost/health || exit 1"]
interval: 10s
timeout: 5s
retries: 5
start_period: 10s

Pattern 3: Upstream Routing Map

PathUpstreamNotes
/aithena-ui:5173React dev server (Vite)
/v1/solr-search:8080FastAPI search API
/admin/solr/solr1:8983Solr admin UI
/rabbitmq/rabbitmq:15672RabbitMQ management
/streamlit/admin:8501Streamlit admin dashboard
/redis/redis-commander:8081Redis Commander UI
/healthlocalnginx health check

Key: Each upstream path must handle trailing slashes and websocket upgrades (for Vite HMR and Streamlit).

Pattern 4: Startup Ordering (Last-to-Start)

nginx depends on all upstream services being healthy. It must start last to avoid 502 errors during cold start.

yaml
nginx:
depends_on:
solr-search:
condition: service_healthy
aithena-ui:
condition: service_healthy
admin:
condition: service_healthy
rabbitmq:
condition: service_healthy

Rationale: If nginx starts before upstreams are ready, clients see 502 Bad Gateway. The service_healthy condition prevents this.

Pattern 5: SSL as Compose Overlay

SSL/TLS (certbot) is optional. The base compose file runs HTTP-only. SSL is added via overlay:

bash
# HTTP-only (default):
docker compose up -d
# With SSL:
docker compose -f docker-compose.yml -f docker/compose.ssl.yml up -d

Why overlay instead of profiles: Docker Compose profiles can disable the certbot service but can't conditionally add volume mounts or port bindings to nginx. The overlay cleanly isolates:

  • certbot service definition
  • nginx SSL volume mounts (/etc/letsencrypt, /var/www/certbot)
  • Port 443 binding
  • SSL-specific nginx config snippets

Anti-Patterns

  • Don't publish host ports on backend services — route everything through nginx
  • Don't start nginx before upstreams are healthy — causes 502 errors
  • Don't use `proxy_pass` without trailing slash consistency — causes path rewriting bugs
  • Don't put SSL config in the base compose file — use overlay for optional features
  • Don't skip `access_log off` on health endpoints — pollutes logs with high-frequency noise

References

  • src/nginx/ — nginx configuration files
  • docker-compose.yml — nginx service definition and dependencies
  • docker/compose.ssl.yml — SSL overlay with certbot
  • Skill docker-health-checks — health check patterns for all services

Security

  • Security scanPassed, 90 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

7-day trend score
0

Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/jmservera/aithena/nginx-reverse-proxy/badge)](https://verified-skill.com/skills/jmservera/aithena/nginx-reverse-proxy)

Something wrong with this skill or its page? Tell us.