{"id":31585059,"url":"https://github.com/denisetiya/nginx-gateway","last_synced_at":"2026-04-18T15:40:25.069Z","repository":{"id":314832986,"uuid":"1056914577","full_name":"denisetiya/nginx-gateway","owner":"denisetiya","description":"A reusable and production-ready API Gateway built on Nginx with: Automatic SSL (Let’s Encrypt), Rate limiting, Easy service registration scripts, Full Docker Compose setup","archived":false,"fork":false,"pushed_at":"2025-09-15T03:16:12.000Z","size":14,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-11-10T16:10:23.532Z","etag":null,"topics":["api-gateway","config","docker","docker-compose","nginx","nginx-api-gateway","server-configuration"],"latest_commit_sha":null,"homepage":"","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/denisetiya.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-09-15T02:59:37.000Z","updated_at":"2025-09-15T03:27:16.000Z","dependencies_parsed_at":"2025-09-15T05:23:52.932Z","dependency_job_id":"eed344ee-3535-4b57-b6bb-5053e8179d0c","html_url":"https://github.com/denisetiya/nginx-gateway","commit_stats":null,"previous_names":["denisetiya/nginx-gateway"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/denisetiya/nginx-gateway","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/denisetiya%2Fnginx-gateway","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/denisetiya%2Fnginx-gateway/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/denisetiya%2Fnginx-gateway/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/denisetiya%2Fnginx-gateway/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/denisetiya","download_url":"https://codeload.github.com/denisetiya/nginx-gateway/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/denisetiya%2Fnginx-gateway/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31974952,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-18T00:39:45.007Z","status":"online","status_checked_at":"2026-04-18T02:00:07.018Z","response_time":103,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api-gateway","config","docker","docker-compose","nginx","nginx-api-gateway","server-configuration"],"created_at":"2025-10-06T01:26:48.545Z","updated_at":"2026-04-18T15:40:25.022Z","avatar_url":"https://github.com/denisetiya.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🚀 Nginx API Gateway with Rate Limiting \u0026 Auto SSL\n\n[![Nginx](https://img.shields.io/badge/Nginx-1.27+-green?logo=nginx\\\u0026logoColor=white)](https://nginx.org/)\n[![Docker](https://img.shields.io/badge/Docker-Compose-blue?logo=docker\\\u0026logoColor=white)](https://docs.docker.com/compose/)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](./LICENSE)\n[![SSL](https://img.shields.io/badge/SSL-Auto%20Renewal-success?logo=letsencrypt)](https://letsencrypt.org/)\n[![Rate Limit](https://img.shields.io/badge/Rate--Limiting-10r/s-orange)](#rate-limiting)\n\nA **reusable** and **production-ready** API Gateway built on **Nginx** with:\n\n- ✅ Automatic SSL (**Let’s Encrypt**)\n- ✅ Rate limiting per IP\n- ✅ Easy service registration scripts\n- ✅ Full **Docker Compose** setup\n\n---\n\n\n## ⛩️ Architecture\n\n```mermaid\ngraph TD\n    A[Client] --\u003e B(Nginx API Gateway)\n    B --\u003e C{Rate Limiting}\n    C --\u003e D[Service 1]\n    C --\u003e E[Service 2]\n    C --\u003e F[Service N]\n    \n    B --\u003e G[(SSL Termination)]\n    G --\u003e H[Let's Encrypt]\n    \n    subgraph \"API Gateway\"\n        B\n        C\n        G\n    end\n    \n    subgraph \"Services\"\n        D\n        E\n        F\n    end\n    \n    subgraph \"Security\"\n        H\n    end\n```\n\n## ✨ Features\n\n* 🔒 **Security by default** → SSL, security headers, CORS\n* ⚡ **Rate limiting** → 10 r/s per IP (burst 20)\n* 🐳 **Dockerized** → Ready to deploy with `docker-compose`\n* 🛠️ **Easy service config** → Add new APIs with a single script\n\n---\n\n## 📋 Prerequisites\n\n* [Docker](https://docs.docker.com/get-docker/) \u0026 [Docker Compose](https://docs.docker.com/compose/)\n* A domain name pointing to your server\n\n---\n\n## ⚙️ Setup Instructions\n\n1. **Configure Docker Compose**\n   Edit [`docker-compose.yml`](./docker-compose.yml):\n\n   * Replace `your-email@example.com`\n   * Replace `your-domain.com`\n\n2. **Start the gateway**\n\n   ```bash\n   docker-compose up -d\n   ```\n\n3. **Add new services**\n   Linux/Mac:\n\n   ```bash\n   ./add-service.sh SERVICE_NAME SERVICE_PORT SERVICE_PREFIX DOMAIN\n   ```\n\n   Windows:\n\n   ```cmd\n   add-service.bat SERVICE_NAME SERVICE_PORT SERVICE_PREFIX DOMAIN\n   ```\n\n   Example:\n\n   ```bash\n   ./add-service.sh user-service 3000 /api/users example.com\n   ```\n\n4. **Restart Nginx**\n\n   ```bash\n   docker-compose restart nginx\n   ```\n\n---\n\n## 🔧 Configuration\n\n### Rate Limiting\n\n```nginx\nlimit_req_zone $binary_remote_addr zone=api:10m rate=10r/s;\n```\n\n* Default: `10r/s` per IP\n* Burst: `20 requests`\n* Zone size: `10MB (~160k IPs)`\n\n### SSL\n\n```nginx\nssl_protocols TLSv1.2 TLSv1.3;\nssl_ciphers HIGH:!aNULL:!MD5;\n```\n\n* Certificates managed by **Certbot**\n* Stored in `/ssl`\n* Auto renewal enabled\n\n---\n\n## 🐞 Troubleshooting\n\n* **Check SSL logs**\n\n  ```bash\n  docker-compose logs certbot\n  ```\n* **Test Nginx config**\n\n  ```bash\n  docker-compose exec nginx nginx -t\n  ```\n* **Check rate limit logs**\n\n  ```bash\n  docker-compose logs nginx\n  ```\n\n---\n\n## 📂 Directory Structure\n\n```\nnginx-gateway/\n├── docker-compose.yml        # Docker Compose config\n├── nginx.conf                 # Main Nginx config\n├── conf.d/                    # Service configs\n│   └── service-template.conf\n├── ssl/                       # SSL certificates\n├── www/                       # Certbot webroot\n│   └── rate-limit.html\n├── logs/                      # Nginx logs\n├── add-service.sh             # Add service (Linux/Mac)\n└── add-service.bat            # Add service (Windows)\n```\n\n---\n\n## 📖 Example Usage\n\nSee [example-usage.md](./example-usage.md) for real service integration examples.\n\n---\n\n## 📜 License\n\nThis project is open source and available under the MIT License. See the [LICENSE](LICENSE) file for more information.\n\n---","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdenisetiya%2Fnginx-gateway","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdenisetiya%2Fnginx-gateway","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdenisetiya%2Fnginx-gateway/lists"}