📄 SKILL.md

← Vault

name: kong-supabase-edge-functions-503-debug

description: Debug and fix 503 errors on Supabase Edge Functions exposed via Kong on VPS — DNS resolution failures and upstream hostname issues.

triggers:

- Kong 503 name resolution failed

- Kong returning 503 for /functions/v1/ endpoints

- Edge Function unreachable from browser but curl works inside container


Symptoms

Making the proxy permanent

The deploy-vps-functions-proxy container created with docker run is NOT permanent — it won't survive docker compose down. Add to docker-compose.yml:

`yaml

functions-proxy:

image: nginx:alpine

container_name: deploy-vps-functions-proxy

volumes:

- /tmp/functions-proxy.conf:/etc/nginx/conf.d/default.conf:ro

networks:

deploy-vps_default:

aliases:

- functions-proxy

restart: unless-stopped

expose:

- "9000"

`

Key Lessons

1. 503 + name resolution failed = Kong can't resolve upstream hostname in Docker DNS

2. kong reload is insufficient for upstream hostname changes — always do docker restart after modifying Kong's upstream config

3. Check Docker network aliases with docker inspect — if aliases is [] or null, the container has no DNS name

4. Use nginx proxy sidecar instead of hardcoding IPs — stable DNS name that survives restarts