{"id":13812037,"url":"https://github.com/repsheet/repsheet-nginx","last_synced_at":"2025-12-17T07:57:20.088Z","repository":{"id":16080668,"uuid":"18825249","full_name":"repsheet/repsheet-nginx","owner":"repsheet","description":"The nginx module for Repsheet","archived":false,"fork":false,"pushed_at":"2025-10-06T07:55:26.000Z","size":1685,"stargazers_count":82,"open_issues_count":17,"forks_count":11,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-06T09:42:31.220Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C","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/repsheet.png","metadata":{"files":{"readme":"README.md","changelog":"ChangeLog","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":"2014-04-16T03:15:43.000Z","updated_at":"2023-10-25T19:38:22.000Z","dependencies_parsed_at":"2024-01-18T02:38:19.575Z","dependency_job_id":"16fe091f-76d4-4ade-a2ab-ae823f043703","html_url":"https://github.com/repsheet/repsheet-nginx","commit_stats":null,"previous_names":[],"tags_count":23,"template":false,"template_full_name":null,"purl":"pkg:github/repsheet/repsheet-nginx","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/repsheet%2Frepsheet-nginx","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/repsheet%2Frepsheet-nginx/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/repsheet%2Frepsheet-nginx/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/repsheet%2Frepsheet-nginx/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/repsheet","download_url":"https://codeload.github.com/repsheet/repsheet-nginx/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/repsheet%2Frepsheet-nginx/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":27779779,"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","status":"online","status_checked_at":"2025-12-17T02:00:08.291Z","response_time":55,"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":[],"created_at":"2024-08-04T04:00:45.396Z","updated_at":"2025-12-17T07:57:20.072Z","avatar_url":"https://github.com/repsheet.png","language":"C","funding_links":[],"categories":["C"],"sub_categories":[],"readme":"# Repsheet NGINX [![Build Status](https://secure.travis-ci.org/repsheet/repsheet-nginx.png)](http://travis-ci.org/repsheet/repsheet-nginx?branch=master)\n\n## How does it work?\n\nRepsheet works by inspecting requests as they come into the web server\nand checking the requesting actor's status in a cache. When a request\ncomes in, the status of the actor is used to determine the required\naction. If the actor has been flagged, that information is added and\nthe header `X-Repsheet: \u003creason\u003e`. If the actor has been blacklisted,\nRepsheet instructs NGINX to return a 403.\n\nAn actor can be defined by either an IP address or a cookie value. By\ndefault Repsheet looks at the IP address of the requesting actor\nusing the directly connected IP address provided by NGINX or by\nexamining the `X-Forwarded-For` header if enabled using the\n`repsheet_proxy_headers` directive.\n\n## Dependencies\n\n* [hiredis](https://github.com/redis/hiredis) 0.11 or greater\n* [Redis](http://redis.io) 4.0 or greater\n* [Repsheet Redis Module](https://github.com/repsheet/redis_module)\n\n#### Installation\n\nYou can install this module the traditional way by compiling it in or\nby compiling it as a shared module. To activate and configure\nRepsheet you will need to set some directives. The following list\nexplains what each directive is and what is does.\n\n* `repsheet \u003con|off\u003e` - Determines if Repsheet will do any processing\n\n* `repsheet_redis_host \u003chost\u003e` - Sets the host for the Redis connection\n* `repsheet_redis_port \u003cport\u003e` - Sets the port for the Redis connection\n* `repsheet_redis_connection_timeout \u003cn\u003e` - Sets the Redis connection timeout (in milliseconds)\n* `repsheet_redis_read_timeout \u003cn\u003e` - Sets the Redis request timeout (in milliseconds)\n\n* `repsheet_proxy_headers \u003con|off\u003e` - Determines if Repsheet will use the X-Forwarded-For header\n* `repsheet_proxy_headers_header \u003cheader\u003e` - Sets an alternate header to use for the source ip\n* `repsheet_proxy_fallback \u003con|off\u003e` - Uses X-Forwarded-For as a fallback if `proxy_headers_header` fails to find a valid address\n\nHere's a simple example NGINX config:\n\n```\nevents {\n  worker_connections  1024;\n}\n\nhttp {\n  repsheet on;\n  repsheet_redis_host localhost;\n  repsheet_redis_port 6379;\n  repsheet_redis_connection_timeout 5;\n  repsheet_redis_read_timeout 10;\n  repsheet_proxy_headers on;\n  repsheet_proxy_headers_header \"True-Client-IP\";\n  repsheet_proxy_fallback on;\n\n  server {\n    listen 8888;\n    location / {\n\n    }\n  }\n}\n```\n\n## Running the Integration Tests\n\nThis project comes with a basic set of integration tests to ensure\nthat things are working. If you want to run the tests, you will need\nto have [Ruby](http://www.ruby-lang.org/en/),\n[RubyGems](http://rubygems.org/), and [Bundler](http://bundler.io/)\ninstalled. In order to run the integration tests, use the following\ncommands:\n\n```sh\n$ bundle install\n$ script/bootstrap\n$ rake\n```\n\nThe `script/bootstrap` task will take some time. It downloads and\ncompiles NGINX, and then configures everything to work\ntogether. Running `rake` launches some curl based tests that hit the\nsite and exercise Repsheet, then test that everything is working as\nexpected.\n\n## Building for Linux with Docker\n\nThe file docker/Dockerfile works with docker to create a standalone\ninstance of CentOS Linux, install all the dependencies, and compile\nand test repsheet-nginx. Once you have installed docker on your system\nsimply run:\n\n```\n$ cd docker\n$ docker build repsheet .\n```\n\nThis builds the docker image defined in Dockerfile, which includes\ncreating a working instance of nginx with the repsheet module and\nredis installed.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frepsheet%2Frepsheet-nginx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frepsheet%2Frepsheet-nginx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frepsheet%2Frepsheet-nginx/lists"}