https://github.com/maxiviper117/example-caddy-ratelimiting
https://github.com/maxiviper117/example-caddy-ratelimiting
caddy example rate-limiting
Last synced: 8 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/maxiviper117/example-caddy-ratelimiting
- Owner: Maxiviper117
- Created: 2025-03-01T17:31:04.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-03-01T17:34:08.000Z (about 1 year ago)
- Last Synced: 2025-03-01T18:31:46.809Z (about 1 year ago)
- Topics: caddy, example, rate-limiting
- Language: Shell
- Homepage:
- Size: 2.93 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Example Caddy Rate Limiting Repository
This repository demonstrates how to configure Caddy with rate limiting.
## Overview
- Uses a custom Dockerfile to build Caddy with the [caddy-ratelimit](https://github.com/mholt/caddy-ratelimit) module.
- Provides a Caddyfile with two rate limiting zones:
- **Static Zone:** Applies globally to all GET requests.
- **Dynamic Zone:** Applies separately per client IP.
## Files
- **Caddyfile:** Configuration for Caddy and rate limiting.
- **Dockerfile:** Builds the custom Caddy image with the rate limit module.
- **docker-compose.yml:** Runs Caddy with Docker Compose.
- **test_ratelimit.sh:** Script to test rate limit behavior.
## Getting Started
1. **Build the Docker image:**
```bash
docker build -t my-caddy-ratelimit .
```
2. **Run with Docker Compose:**
```bash
docker-compose up --build -d
```
3. **Testing Rate Limiting:**
Run the test script:
```bash
./test_ratelimit.sh
```
## Notes
- Adjust the test script and Caddyfile configurations as needed for your environment.
- The repository provides an example setup for demonstration purposes.