{"id":17790930,"url":"https://github.com/cubicdaiya/ngx_dynamic_upstream","last_synced_at":"2025-04-05T08:06:20.841Z","repository":{"id":31775586,"uuid":"35341929","full_name":"cubicdaiya/ngx_dynamic_upstream","owner":"cubicdaiya","description":"Dynamic upstream for nginx","archived":false,"fork":false,"pushed_at":"2021-04-03T18:04:31.000Z","size":44,"stargazers_count":502,"open_issues_count":14,"forks_count":109,"subscribers_count":43,"default_branch":"master","last_synced_at":"2025-03-29T07:05:50.883Z","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":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cubicdaiya.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}},"created_at":"2015-05-09T19:23:12.000Z","updated_at":"2025-02-07T14:52:49.000Z","dependencies_parsed_at":"2022-09-10T12:12:47.994Z","dependency_job_id":null,"html_url":"https://github.com/cubicdaiya/ngx_dynamic_upstream","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cubicdaiya%2Fngx_dynamic_upstream","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cubicdaiya%2Fngx_dynamic_upstream/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cubicdaiya%2Fngx_dynamic_upstream/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cubicdaiya%2Fngx_dynamic_upstream/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cubicdaiya","download_url":"https://codeload.github.com/cubicdaiya/ngx_dynamic_upstream/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247305933,"owners_count":20917208,"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":"2024-10-27T10:48:30.607Z","updated_at":"2025-04-05T08:06:20.817Z","avatar_url":"https://github.com/cubicdaiya.png","language":"C","funding_links":[],"categories":["Honourable mentions"],"sub_categories":[],"readme":"# ngx_dynamic_upstream\n\n`ngx_dynamic_upstream` is the module for operating upstreams dynamically with HTTP APIs\nsuch as [`ngx_http_upstream_conf`](http://nginx.org/en/docs/http/ngx_http_upstream_conf_module.html).\n\n# Requirements\n\n`ngx_dynamic_upstream` requires the `zone` directive in the `upstream` context.\nThis directive is available in nginx-1.9.0-plus.\n\n# Status\n\nProduction ready.\n\n# Directives\n\n## dynamic_upstream\n\n|Syntax |dynamic_upstream|\n|-------|----------------|\n|Default|-|\n|Context|location|\n\nNow `ngx_dynamic_upstream` supports dynamic upstream under only `http` context.\n\n# Quick Start\n\n```nginx\nupstream backends {\n    zone zone_for_backends 1m;\n    server 127.0.0.1:6001;\n    server 127.0.0.1:6002;\n    server 127.0.0.1:6003;\n}\n\nserver {\n    listen 6000;\n\n    location /dynamic {\n\t\tallow 127.0.0.1;\n\t    deny all;\n        dynamic_upstream;\n    }\n\n    location / {\n\t    proxy_pass http://backends;\n    }\n}\n```\n\n# HTTP APIs\n\nYou can operate upstreams dynamically with HTTP APIs.\n\n## list\n\n```bash\n$ curl \"http://127.0.0.1:6000/dynamic?upstream=zone_for_backends\"\nserver 127.0.0.1:6001;\nserver 127.0.0.1:6002;\nserver 127.0.0.1:6003;\n$\n```\n\n## verbose\n\n```bash\n$ curl \"http://127.0.0.1:6000/dynamic?upstream=zone_for_backends\u0026verbose=\"\nserver 127.0.0.1:6001 weight=1 max_fails=1 fail_timeout=10;\nserver 127.0.0.1:6002 weight=1 max_fails=1 fail_timeout=10;\nserver 127.0.0.1:6003 weight=1 max_fails=1 fail_timeout=10;\n$\n```\n\n## update_parameters\n\n```bash\n$ curl \"http://127.0.0.1:6000/dynamic?upstream=zone_for_backends\u0026server=127.0.0.1:6003\u0026weight=10\u0026max_fails=5\u0026fail_timeout=5\"\nserver 127.0.0.1:6001 weight=1 max_fails=1 fail_timeout=10;\nserver 127.0.0.1:6002 weight=1 max_fails=1 fail_timeout=10;\nserver 127.0.0.1:6003 weight=10 max_fails=5 fail_timeout=5;\n$\n```\n\nThe supported parameters are blow.\n\n * weight\n * max_fails\n * fail_timeout\n\n## down\n\n```bash\n$ curl \"http://127.0.0.1:6000/dynamic?upstream=zone_for_backends\u0026server=127.0.0.1:6003\u0026down=\"\nserver 127.0.0.1:6001 weight=1 max_fails=1 fail_timeout=10;\nserver 127.0.0.1:6002 weight=1 max_fails=1 fail_timeout=10;\nserver 127.0.0.1:6003 weight=1 max_fails=1 fail_timeout=10 down;\n$\n```\n\n## up\n\n```bash\n$ curl \"http://127.0.0.1:6000/dynamic?upstream=zone_for_backends\u0026server=127.0.0.1:6003\u0026up=\"\nserver 127.0.0.1:6001 weight=1 max_fails=1 fail_timeout=10;\nserver 127.0.0.1:6002 weight=1 max_fails=1 fail_timeout=10;\nserver 127.0.0.1:6003 weight=1 max_fails=1 fail_timeout=10;\n$\n```\n\n## add\n\n```bash\n$ curl \"http://127.0.0.1:6000/dynamic?upstream=zone_for_backends\u0026add=\u0026server=127.0.0.1:6004\"\nserver 127.0.0.1:6001;\nserver 127.0.0.1:6002;\nserver 127.0.0.1:6003;\nserver 127.0.0.1:6004;\n$\n```\n\n## remove\n\n```bash\n$ curl \"http://127.0.0.1:6000/dynamic?upstream=zone_for_backends\u0026remove=\u0026server=127.0.0.1:6003\"\nserver 127.0.0.1:6001;\nserver 127.0.0.1:6002;\nserver 127.0.0.1:6004;\n$\n```\n\n# License\n\nSee [LICENSE](https://github.com/cubicdaiya/ngx_dynamic_upstream/blob/master/LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcubicdaiya%2Fngx_dynamic_upstream","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcubicdaiya%2Fngx_dynamic_upstream","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcubicdaiya%2Fngx_dynamic_upstream/lists"}