{"id":27334823,"url":"https://github.com/dmuth/nginx-rate-limiting-playground","last_synced_at":"2025-04-12T14:46:25.930Z","repository":{"id":274717392,"uuid":"922331764","full_name":"dmuth/nginx-rate-limiting-playground","owner":"dmuth","description":null,"archived":false,"fork":false,"pushed_at":"2025-01-28T23:23:36.000Z","size":21,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-06T02:35:21.307Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dmuth.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}},"created_at":"2025-01-25T23:03:36.000Z","updated_at":"2025-01-28T23:23:39.000Z","dependencies_parsed_at":"2025-01-29T00:36:33.280Z","dependency_job_id":null,"html_url":"https://github.com/dmuth/nginx-rate-limiting-playground","commit_stats":null,"previous_names":["dmuth/nginx-rate-limiting-playground"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmuth%2Fnginx-rate-limiting-playground","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmuth%2Fnginx-rate-limiting-playground/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmuth%2Fnginx-rate-limiting-playground/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmuth%2Fnginx-rate-limiting-playground/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dmuth","download_url":"https://codeload.github.com/dmuth/nginx-rate-limiting-playground/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248585222,"owners_count":21128966,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2025-04-12T14:46:25.076Z","updated_at":"2025-04-12T14:46:25.922Z","avatar_url":"https://github.com/dmuth.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# Nginx Rate Limiting Playground\n\nThis repo has some Docker containers which can be used to test out rate limiting in Nginx.\nI was inspired to create this after reading [this blog post](https://dev.to/mspilari/understanding-rate-limiting-a-guide-to-protecting-your-apis-and-applications-254c) from Matheus Bernardes Spilari over on [dev.to](https://dev.to/).\n\nThe containers are:\n\n- `httpbin` - An instance of [FastAPI Httpbin](https://httpbin.dmuth.org/), which provides HTTP endpoints.\n  - Accessible directly via [http://localhost:8001/](http://localhost:8001/)\n- `nginx` - An Nginx webserver acting as a proxy to `httpbin`, along with some rate limiting.\n  - Accessible directly via [http://localhost:8000/](http://localhost:8000/)\n  - Rate limiting settings should be configured in the `env` file.\n- `tools` - A container which has an instance of Apache Benchmark for testing purposes.\n\n\n## Usage\n\nEdit the `env` file to change settings accordingly in the Nginx config file.  Then start the containers and run something like `./bin/exec-tools-ab.sh -n5` to run 5 queries against the Nginx server.\n\nYou can also edit `conf/nginx.conf.template` if you want to try other configurations in Nginx.\n\n### Scripts\n\nThe `bin/` directory contains a ton of helper scripts which (mostly) map to various Docker Compose commands.\nThose scripts can be used to stand up and test out Nginx's rate-limiting:\n\n- `./bin/build.sh` - Build containers\n- `./bin/up-d.sh` - Start containers in the background\n  - `up.sh` - Use this if you want to start containers in the foreground\n- `./bin/ps.sh` - View running containers\n- `./bin/logs-f.sh` - View logs from running containers\n- `./bin/restart.sh` - Restart containers\n- `./bin/kill.sh` - Kill all containers\n- `./bin/exec-tools-ab.sh`\n  - Wrapper to run `ab` against the `nginx` container from the `tools` container\n- `./bin/exec-tools.sh` \n  - Script to spawn an interactive shell on the `tools` container.\n\n\n## Future Plans\n\nNone at the moment!  I build this app mostly to play around with Nginx proxying and rate limiting.  If I have more work to do in that space, I may come back to this project.  Otherwise I won't.\n\nFeel free to make use of this project if you want to play with Nginx rate limiting, though!\n\n\n## Contact\n\nYou can find me on the web at [https://www.dmuth.org/contact](https://www.dmuth.org/contact), or\nopen an Issue here if you'd like to reach out!\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdmuth%2Fnginx-rate-limiting-playground","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdmuth%2Fnginx-rate-limiting-playground","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdmuth%2Fnginx-rate-limiting-playground/lists"}