{"id":23092663,"url":"https://github.com/kjdev/nginx-keyval","last_synced_at":"2025-08-16T10:31:17.678Z","repository":{"id":61324887,"uuid":"549959097","full_name":"kjdev/nginx-keyval","owner":"kjdev","description":"Nginx module for the key-value store","archived":false,"fork":false,"pushed_at":"2024-12-19T00:04:23.000Z","size":126,"stargazers_count":23,"open_issues_count":2,"forks_count":4,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-06-08T02:53:58.072Z","etag":null,"topics":["key-value","nginx"],"latest_commit_sha":null,"homepage":"","language":"Perl","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/kjdev.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":"2022-10-12T01:56:41.000Z","updated_at":"2025-04-02T04:28:33.000Z","dependencies_parsed_at":"2023-11-07T04:26:35.460Z","dependency_job_id":"72eac8f8-e80d-4715-b243-0fafb0f241c0","html_url":"https://github.com/kjdev/nginx-keyval","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/kjdev/nginx-keyval","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kjdev%2Fnginx-keyval","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kjdev%2Fnginx-keyval/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kjdev%2Fnginx-keyval/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kjdev%2Fnginx-keyval/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kjdev","download_url":"https://codeload.github.com/kjdev/nginx-keyval/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kjdev%2Fnginx-keyval/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270701573,"owners_count":24630868,"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-08-16T02:00:11.002Z","response_time":91,"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":["key-value","nginx"],"created_at":"2024-12-16T21:35:41.105Z","updated_at":"2025-08-16T10:31:17.663Z","avatar_url":"https://github.com/kjdev.png","language":"Perl","funding_links":[],"categories":[],"sub_categories":[],"readme":"nginx-keyval\n============\n\nThis nginx module creates variables with values taken from key-value pairs.\n\n\u003e This module is heavily inspired by the nginx original\n\u003e [http_keyval_module](https://nginx.org/en/docs/http/ngx_http_keyval_module.html).\n\nDependency\n----------\n\nUsing the Redis store.\n\n- [hiredis](https://github.com/redis/hiredis)\n\nInstallation\n------------\n\n### Build install\n\n``` sh\n$ : \"clone repository\"\n$ git clone https://github.com/kjdev/nginx-keyval\n$ cd nginx-keyval\n$ : \"get nginx source\"\n$ NGINX_VERSION=1.x.x # specify nginx version\n$ wget http://nginx.org/download/nginx-${NGINX_VERSION}.tar.gz\n$ tar -zxf nginx-${NGINX_VERSION}.tar.gz\n$ cd nginx-${NGINX_VERSION}\n$ : \"using redis store\"\n$ : export NGX_KEYVAL_ZONE_REDIS=1\n$ : \"build module\"\n$ ./configure --add-dynamic-module=../\n$ make \u0026\u0026 make install\n```\n\n### Docker\n\n``` sh\n$ docker build -t nginx-keyval .\n$ : \"app.conf: Create nginx configuration\"\n$ docker run -p 80:80 -v $PWD/app.conf:/etc/nginx/http.d/default.conf nginx-keyval\n```\n\n\u003e Github package: ghcr.io/kjdev/nginx-keyval/nginx\n\nConfiguration: `ngx_http_keyval_module`\n---------------------------------------\n\n### Example\n\n```\nhttp {\n  keyval_zone zone=one:32k;\n  keyval $arg_text $text zone=one;\n  ...\n  server {\n    ...\n    location / {\n      return 200 $text;\n    }\n  }\n}\n```\n\n### Directives\n\n```\nSyntax: keyval key $variable zone=name;\nDefault: -\nContext: http\n```\n\nCreates a new `$variable` whose value is looked up by the `key`\nin the key-value database.\n\nThe database is stored in shared memory or Redis as specified\nby the zone parameter.\n\nIn `key`, you can use a mix of variables and text or just variables.\n\n\u003e For example:\n\u003e - `$remote_addr:$http_user_agent`\n\u003e - `'$remote_addr    $http_user_agent   $host \"a random text\"'`\n\n```\nSyntax: keyval_zone zone=name:size [timeout=time] [ttl=time];\nDefault: -\nContext: http\n```\n\nSets the `name` and `size` of the shared memory zone that\nkeeps the key-value database.\n\nThe optional `timeout` or `ttl` parameter sets the time to live\nwhich key-value pairs are removed (default value is `0` seconds).\n\n```\nSyntax: keyval_zone_redis zone=name [hostname=name] [port=number] [database=number] [connect_timeout=time] [ttl=time];\nDefault: -\nContext: http\n```\n\n\u003e Using the Redis store\n\nSets the `name` of the Redis zone that keeps the key-value database.\n\nThe optional `hostname` parameter sets the Redis hostname\n(default value is `127.0.0.1`).\n\nThe optional `port` parameter sets the Redis port\n(default value is `6379`).\n\nThe optional `database` parameter sets the Redis database number\n(default value is `0`).\n\nThe optional `connect_timeout` parameter sets the Redis connection\ntimeout seconds (default value is `3`).\n\nThe optional `ttl` parameter sets the time to live\nwhich key-value pairs are removed (default value is `0` seconds).\n\nConfiguration: `ngx_stream_keyval_module`\n---------------------------------------\n\n### Example\n\n```\nstream {\n  keyval_zone zone=one:32k;\n  keyval $ssl_server_name $name zone=one;\n\n  server {\n    listen 12345 ssl;\n    proxy_pass $name;\n    ssl_certificate /usr/share/nginx/conf/cert.pem;\n    ssl_certificate_key /usr/share/nginx/conf/cert.key;\n  }\n}\n```\n\n### Directives\n\n```\nSyntax: keyval key $variable zone=name;\nDefault: -\nContext: http\n```\n\nCreates a new `$variable` whose value is looked up by the `key`\nin the key-value database.\n\nThe database is stored in shared memory or Redis as specified\nby the zone parameter.\n\n```\nSyntax: keyval_zone zone=name:size [timeout=time] [ttl=time];\nDefault: -\nContext: http\n```\n\nSets the `name` and `size` of the shared memory zone that\nkeeps the key-value database.\n\nThe optional `timeout` or `ttl` parameter sets the time to live which key-value pairs are removed (default value is 0 seconds).\n\n```\nSyntax: keyval_zone_redis zone=name [hostname=name] [port=number] [database=number] [connect_timeout=time] [ttl=time];\nDefault: -\nContext: http\n```\n\n\u003e Using the Redis store\n\nSets the `name` of the Redis zone that keeps the key-value database.\n\nThe optional `hostname` parameter sets the Redis hostname\n(default value is `127.0.0.1`).\n\nThe optional `port` parameter sets the Redis port\n(default value is `6379`).\n\nThe optional `database` parameter sets the Redis database number\n(default value is `0`).\n\nThe optional `connect_timeout` parameter sets the Redis connection\ntimeout seconds (default value is `3`).\n\nThe optional `ttl` parameter sets the time to live\nwhich key-value pairs are removed (default value is `0` seconds).\n\nExample\n-------\n\n- [OpenID Connect Authentication](example/README.md)\n\n\nTODO\n----\n\n- [ ] Support for `[state=file]` in `keyval_zone` directive\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkjdev%2Fnginx-keyval","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkjdev%2Fnginx-keyval","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkjdev%2Fnginx-keyval/lists"}