{"id":20912247,"url":"https://github.com/ansuel/nginx-ubus-module","last_synced_at":"2025-10-29T03:44:29.145Z","repository":{"id":114059633,"uuid":"217182641","full_name":"Ansuel/nginx-ubus-module","owner":"Ansuel","description":"Nginx module to interact with penwrt ubus daemon","archived":false,"fork":false,"pushed_at":"2024-03-02T14:12:01.000Z","size":150,"stargazers_count":10,"open_issues_count":2,"forks_count":6,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-01T20:07:37.744Z","etag":null,"topics":["nginx","openwrt","ubus","ubus-module"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Ansuel.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"custom":["https://www.paypal.me/AnsuelS"]}},"created_at":"2019-10-24T01:08:31.000Z","updated_at":"2025-03-03T09:24:43.000Z","dependencies_parsed_at":"2024-11-18T14:35:23.634Z","dependency_job_id":"a02e9778-58a4-4cfe-aa36-dd6055f8ceaf","html_url":"https://github.com/Ansuel/nginx-ubus-module","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ansuel%2Fnginx-ubus-module","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ansuel%2Fnginx-ubus-module/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ansuel%2Fnginx-ubus-module/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ansuel%2Fnginx-ubus-module/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Ansuel","download_url":"https://codeload.github.com/Ansuel/nginx-ubus-module/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253894965,"owners_count":21980427,"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":["nginx","openwrt","ubus","ubus-module"],"created_at":"2024-11-18T14:26:11.466Z","updated_at":"2025-10-29T03:44:24.100Z","avatar_url":"https://github.com/Ansuel.png","language":"C","funding_links":["https://www.paypal.me/AnsuelS"],"categories":[],"sub_categories":[],"readme":"[![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://www.paypal.me/AnsuelS) [![License](https://img.shields.io/github/license/Ansuel/nginx-ubus-module.svg?style=flat)](https://github.com/Ansuel/nginx-ubus-module/blob/master/LICENSE)\n\n# Module ngx_http_read_request_body_module\n\nThe `ngx_http_ubus_module` module allows access ubus function directly from nginx without using cgi or additional application to connect to it\nUbus is used in openwrt to gain and set data to the system. Alle the comunication are done in json format.\nThis can be used to make gui that are based on only ubus request and calls.\n\nThis is based on `uhttpd-mod-ubus` module, some procedures are took from `uhttpd` module.\n\n## Configuration example\n\n```nginx\nlocation /ubus {\n        ubus_interpreter;\n        ubus_socket_path /var/run/ubus.sock;\n        ubus_script_timeout 600;\n        ubus_cors off;\n}\n```\n\n## Directives\n\u003cpre\u003e\nSyntax:  \u003cb\u003eubus_interpreter\u003c/b\u003e;\nDefault: —\nContext: location\n\u003c/pre\u003e\n\nEnable ubus_interpreter on the location set\n\n\u003cpre\u003e\nSyntax:  \u003cb\u003eubus_socket_path\u003c/b\u003e;\nDefault: —\nContext: location\n\u003c/pre\u003e\n\nThe path to the socket the module will connect to. Without this the module will report a json error with Internal Error\n\n\u003cpre\u003e\nSyntax:  \u003cb\u003eubus_script_timeout\u003c/b\u003e;\nDefault: 60\nContext: location\n\u003c/pre\u003e\n\nUbus connection will be terminated after the timeout is exceeded\n\n\u003cpre\u003e\nSyntax:  \u003cb\u003eubus_cors\u003c/b\u003e;\nDefault: 0\nContext: location\n\u003c/pre\u003e\n\nAdds cors header security options to every response header\n\n\u003cpre\u003e\nSyntax:  \u003cb\u003eubus_noauth\u003c/b\u003e;\nDefault: 0\nContext: location\n\u003c/pre\u003e\n\nOnly for test purpose. This will denied every request.\n\n## Thread support\n\nWith Nginx compiled with threads support `--with-threads`, module will use (and requires) Nginx Thread Pool feature. As Nginx configuration suggest, this module will require in the main configuration a Thread Pool and in the location section reference to the named Thread Pool with the name `ubus_interpreter`.\n\n\u003cpre\u003e\n\u003cb\u003ethread_pool ubus_interpreter threads=16;\u003c/b\u003e\n\u003c/pre\u003e\n\u003cpre\u003e\nlocation /ubus {\n        ubus_interpreter;\n        ubus_socket_path /var/run/ubus/ubus.sock;\n        ubus_parallel_req 20;\n\t\u003cb\u003eaio threads=ubus_interpreter;\u003c/b\u003e\n}\n\u003c/pre\u003e\n\nUbus itself doesn't like concurrent request so the performance benefits from this\nare minimal, but this will permits to speedup and prepare each request by removing\nthe overhead of blocking nginx execution waiting for ubus response.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fansuel%2Fnginx-ubus-module","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fansuel%2Fnginx-ubus-module","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fansuel%2Fnginx-ubus-module/lists"}