{"id":23127437,"url":"https://github.com/plinker-rpc/nginx","last_synced_at":"2026-04-26T12:32:19.523Z","repository":{"id":57042726,"uuid":"104473037","full_name":"plinker-rpc/nginx","owner":"plinker-rpc","description":"Nginx as a reverse proxy plinker component","archived":false,"fork":false,"pushed_at":"2020-04-09T02:15:15.000Z","size":238,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-23T21:44:26.588Z","etag":null,"topics":["composer-package","nginx","php","plinker-rpc"],"latest_commit_sha":null,"homepage":"","language":"PHP","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/plinker-rpc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-09-22T12:41:22.000Z","updated_at":"2020-04-09T02:14:38.000Z","dependencies_parsed_at":"2022-08-24T01:10:33.360Z","dependency_job_id":null,"html_url":"https://github.com/plinker-rpc/nginx","commit_stats":null,"previous_names":[],"tags_count":58,"template":false,"template_full_name":null,"purl":"pkg:github/plinker-rpc/nginx","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/plinker-rpc%2Fnginx","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/plinker-rpc%2Fnginx/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/plinker-rpc%2Fnginx/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/plinker-rpc%2Fnginx/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/plinker-rpc","download_url":"https://codeload.github.com/plinker-rpc/nginx/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/plinker-rpc%2Fnginx/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32297893,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-26T09:34:17.070Z","status":"ssl_error","status_checked_at":"2026-04-26T09:34:00.993Z","response_time":129,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["composer-package","nginx","php","plinker-rpc"],"created_at":"2024-12-17T09:09:54.593Z","updated_at":"2026-04-26T12:32:19.507Z","avatar_url":"https://github.com/plinker-rpc.png","language":"PHP","funding_links":["https://www.paypal.me/lcherone"],"categories":[],"sub_categories":[],"readme":"# PlinkerRPC - Nginx\n\nThe aim of this component is to build web forwards/reverse proxy to LXD/LXC \ncontainers on the host (or external upstreams), not as a `server{}` block configurator.\n\nThe component uses nginx as a reverse proxy, it relies on php7-fpm being \ninstalled and will overwrite `/etc/nginx/nginx.conf`! So if you already have\nnginx installed then dont use this component as it will most likely break your stuff.\n\n## Install\n\nRequire this package with composer using the following command:\n\n``` bash\n$ composer require plinker/nginx\n```\n\nThen navigate to `./vendor/plinker/nginx/scripts` and run `bash install.sh`.\n\n\n## Client\n\nCreating a client instance is done as follows:\n\n\n    \u003c?php\n    require 'vendor/autoload.php';\n\n    /**\n     * Initialize plinker client.\n     *\n     * @param string $server - URL to server listener.\n     * @param string $config - server secret, and/or a additional component data\n     */\n    $client = new \\Plinker\\Core\\Client(\n        'http://example.com/server.php',\n        [\n            'secret' =\u003e 'a secret password',\n            // database connection\n            'database' =\u003e [\n                'dsn'      =\u003e 'sqlite:./.plinker/database.db',\n                'host'     =\u003e '',\n                'name'     =\u003e '',\n                'username' =\u003e '',\n                'password' =\u003e '',\n                'freeze'   =\u003e false,\n                'debug'    =\u003e false,\n            ]\n        ]\n    );\n    \n    // or using global function\n    $client = plinker_client('http://example.com/server.php', 'a secret password', [\n        // database connection\n        'database' =\u003e [\n            'dsn'      =\u003e 'sqlite:./.plinker/database.db',\n            'host'     =\u003e '',\n            'name'     =\u003e '',\n            'username' =\u003e '',\n            'password' =\u003e '',\n            'freeze'   =\u003e false,\n            'debug'    =\u003e false,\n        ]\n    ]);\n    \n\n## Methods\n\nOnce setup, you call the class though its namespace to its method.\n\n\n### Setup\n\nApplies build tasks to plinker/tasks queue.\n\n| Parameter   | Type           | Description   | Default        |\n| ----------  | -------------  | ------------- |  ------------- | \n| options     | array          | Build options |                |\n\n**Call**\n\n    $client-\u003enginx-\u003esetup([\n        'build_sleep' =\u003e 5,\n        'reconcile_sleep' =\u003e 5,\n    ]);\n\n**Response**\n``` text\n```\n\n### Update Package\n\nRuns composer update to update package.\n\n**Call**\n\n    $client-\u003enginx-\u003eupdate_package();\n\n**Response**\n``` text\n```\n\n### Add\n\nAdd a web proxy rule.\n\n| Parameter   | Type           | Description   | Default        |\n| ----------  | -------------  | ------------- |  ------------- | \n| data        | array          | Rule data     |                |\n\n**Call**\n\n    $client-\u003enginx-\u003eaddBlock([\n        'label' =\u003e 'My website nginx route',\n        'ownDomain' =\u003e [\n            'example.com',\n            'www.example.com'\n        ],\n        'ownUpstream' =\u003e [\n            ['ip' =\u003e '10.158.250.5', 'port' =\u003e '80']\n        ],\n        'letsencrypt' =\u003e 1,\n        'enabled' =\u003e 1\n    ]);\n    \n**Response**\n\n``` text\nArray\n(\n    [status] =\u003e success\n    [values] =\u003e Array\n        (\n            [id] =\u003e 1\n            [label] =\u003e My website nginx route\n            [name] =\u003e c094c6c1-0fa1-40f1-af66-60e173e8dbac\n            [ssl_type] =\u003e letsencrypt\n            [added] =\u003e 2018-05-13 17:25:51\n            [updated] =\u003e 2018-05-13 17:25:51\n            [has_change] =\u003e 1\n            [has_error] =\u003e 0\n            [delete] =\u003e 0\n            [enabled] =\u003e 1\n            [update_ip] =\u003e 0\n            [ip] =\u003e 10.158.250.5\n            [port] =\u003e 80\n            [ownDomain] =\u003e Array\n                (\n                    [0] =\u003e Array\n                        (\n                            [id] =\u003e 1\n                            [name] =\u003e example.com\n                            [route_id] =\u003e 1\n                        )\n\n                    [1] =\u003e Array\n                        (\n                            [id] =\u003e 2\n                            [name] =\u003e www.example.com\n                            [route_id] =\u003e 1\n                        )\n\n                )\n\n            [ownUpstream] =\u003e Array\n                (\n                    [0] =\u003e Array\n                        (\n                            [id] =\u003e 1\n                            [ip] =\u003e 10.158.250.5\n                            [port] =\u003e 80\n                            [route_id] =\u003e 1\n                        )\n\n                )\n\n        )\n\n)\n```\n\n### Update Block\n\nUpdate a web proxy rule.\n\n| Parameter   | Type           | Description   | Default        |\n| ----------  | -------------  | ------------- |  ------------- | \n| placeholder | string         | Query placeholder |            |\n| values      | array          | Match values      |            |\n| data        | array          | Updated rule data |            |\n\n**Call**\n\n    client-\u003enginx-\u003eupdate('name = ?', ['b2f78de7-5994-4c21-9c55-76cefe327a67'], [\n        'label' =\u003e $test_route_label,\n        'ownDomain' =\u003e [\n            'updated-example.com',\n            'www.updated-example.com'\n        ],\n        'ownUpstream' =\u003e [\n            ['ip' =\u003e '10.158.250.5', 'port' =\u003e '80']\n        ],\n        'letsencrypt' =\u003e 0,\n        'enabled' =\u003e 1\n    ]);\n    \n**Response**\n\n``` text\n\nArray\n(\n    [status] =\u003e success\n    [values] =\u003e Array\n        (\n            [id] =\u003e 3\n            [label] =\u003e Example\n            [name] =\u003e b2f78de7-5994-4c21-9c55-76cefe327a67\n            [ssl_type] =\u003e \n            [added] =\u003e 2018-05-12 20:17:09\n            [updated] =\u003e 2018-05-13 17:28:50\n            [has_change] =\u003e 1\n            [has_error] =\u003e 1\n            [delete] =\u003e 0\n            [enabled] =\u003e 1\n            [update_ip] =\u003e 0\n            [ip] =\u003e 10.158.250.5\n            [port] =\u003e 80\n            [error] =\u003e {}\n            [ownDomain] =\u003e Array\n                (\n                    [0] =\u003e Array\n                        (\n                            [id] =\u003e 9\n                            [name] =\u003e updated-example.com\n                            [route_id] =\u003e 3\n                        )\n\n                    [1] =\u003e Array\n                        (\n                            [id] =\u003e 10\n                            [name] =\u003e www.updated-example.com\n                            [route_id] =\u003e 3\n                        )\n\n                )\n\n            [ownUpstream] =\u003e Array\n                (\n                    [0] =\u003e Array\n                        (\n                            [id] =\u003e 5\n                            [ip] =\u003e 10.158.250.5\n                            [port] =\u003e 80\n                            [route_id] =\u003e 3\n                        )\n\n                )\n\n        )\n\n)\n```\n\n### Remove\n\nRemove web proxy rule.\n\n| Parameter   | Type           | Description   | Default        |\n| ----------  | -------------  | ------------- |  ------------- | \n| placeholder | string         | Query placeholder |            |\n| values      | array          | Match values  |                |\n\n**Call**\n\n    ruleById(1)   - $client-\u003enginx-\u003eremove('id = ?', [1]);\n    ruleByName(1) - $client-\u003enginx-\u003eremove('name = ?', ['guidV4-value'])\n    \n**Response**\n``` text\nArray\n(\n    [status] =\u003e success\n)\n```\n\n### Reset\n\nRemove all web proxy rules.\n\n| Parameter   | Type           | Description   | Default        |\n| ----------  | -------------  | ------------- |  ------------- | \n| purge       | bool           | Also remove tasks | `false`    |\n\n**Call**\n\n    $client-\u003enginx-\u003ereset();     // remove just rules\n    $client-\u003enginx-\u003ereset(true); // remove rules and tasks (purge)\n  \n**Response**\n``` text\nArray\n(\n    [status] =\u003e success\n)\n```\n\n### Fetch\n\nFetch currently configured web proxy rules from database.\n\n| Parameter   | Type           | Description   | Default        |\n| ----------  | -------------  | ------------- |  ------------- | \n| placeholder | string         | Query placeholder | |\n| values      | array          | Match values  |              |\n\n**Call**\n\n    all           - $client-\u003enginx-\u003efetch();\n    ruleById(1)   - $client-\u003enginx-\u003efetch('id = ?', [1]);\n    ruleByName(1) - $client-\u003enginx-\u003efetch('name = ?', ['guidV4-value'])\n    \n**Response**\n``` text\nArray\n(\n    [0] =\u003e Array\n        (\n            [id] =\u003e 1\n            [label] =\u003e Example\n            [name] =\u003e 9801e216-a663-4f21-a3f5-047be2b3b9c9\n            [ssl_type] =\u003e \n            [added] =\u003e 2018-05-12 19:52:58\n            [updated] =\u003e 2018-05-12 19:52:58\n            [has_change] =\u003e 0\n            [has_error] =\u003e 0\n            [delete] =\u003e 0\n            [enabled] =\u003e 1\n            [update_ip] =\u003e 0\n            [ip] =\u003e 10.158.250.5\n            [port] =\u003e 80\n            [error] =\u003e \n            [ownDomain] =\u003e Array\n                (\n                    [0] =\u003e Array\n                        (\n                            [id] =\u003e 1\n                            [name] =\u003e example.com\n                            [route_id] =\u003e 2\n                        )\n\n                    [1] =\u003e Array\n                        (\n                            [id] =\u003e 2\n                            [name] =\u003e www.example.com\n                            [route_id] =\u003e 2\n                        )\n\n                )\n\n            [ownUpstream] =\u003e Array\n                (\n                    [0] =\u003e Array\n                        (\n                            [id] =\u003e 1\n                            [ip] =\u003e 10.158.250.5\n                            [port] =\u003e 80\n                            [route_id] =\u003e 2\n                        )\n\n                )\n\n        )\n)\n```\n\n\n### Count\n\nFetch count of currently configured web proxy rules from database.\n\n| Parameter   | Type           | Description   | Default        |\n| ----------  | -------------  | ------------- |  ------------- | \n| placeholder | string         | Query placeholder | |\n| values      | array          | Match values  |              |\n\n**Call**\n\n    all           - $client-\u003enginx-\u003ecount();\n    ruleById(1)   - $client-\u003enginx-\u003ecount('id = ?', [1]);\n    ruleByName(1) - $client-\u003enginx-\u003ecount('name = ?', ['guidV4-value'])\n    \n**Response**\n``` text\n1\n```\n\n### Rebuild\n\nRebuild web proxy rule.\n\n| Parameter   | Type           | Description   | Default        |\n| ----------  | -------------  | ------------- |  ------------- | \n| placeholder | string         | Query placeholder | |\n| values      | array          | Match values  |              |\n\n**Call**\n\n    ruleById(1)   - $client-\u003enginx-\u003erebuild('id = ?', [1]);\n    ruleByName(1) - $client-\u003enginx-\u003erebuild('name = ?', ['guidV4-value'])\n    \n**Response**\n``` text\nArray\n(\n    [status] =\u003e success\n)\n```\n\n### Status\n\nEnumarate and return status of nginx connections.\n\n**Call**\n\n    $client-\u003enginx-\u003estatus();\n    \n**Response**\n\n``` text\nArray\n(\n    [active_connections] =\u003e 2\n    [accepts] =\u003e 579\n    [handled] =\u003e 579\n    [requests] =\u003e 579\n    [reading] =\u003e 0\n    [writing] =\u003e 2\n    [waiting] =\u003e 0\n)\n```\n\n## Testing\n\nThere are no tests setup for this component.\n\n## Contributing\n\nPlease see [CONTRIBUTING](https://github.com/plinker-rpc/nginx/blob/master/CONTRIBUTING) for details.\n\n## Security\n\nIf you discover any security related issues, please contact me via [https://cherone.co.uk](https://cherone.co.uk) instead of using the issue tracker.\n\n## Credits\n\n- [Lawrence Cherone](https://github.com/lcherone)\n- [All Contributors](https://github.com/plinker-rpc/nginx/graphs/contributors)\n\n\n## Development Encouragement\n\nIf you use this project and make money from it or want to show your appreciation,\nplease feel free to make a donation [https://www.paypal.me/lcherone](https://www.paypal.me/lcherone), thanks.\n\n## Sponsors\n\nGet your company or name listed throughout the documentation and on each github repository, contact me at [https://cherone.co.uk](https://cherone.co.uk) for further details.\n\n## License\n\nThe MIT License (MIT). Please see [License File](https://github.com/plinker-rpc/nginx/blob/master/LICENSE) for more information.\n\nSee the [organisations page](https://github.com/plinker-rpc) for additional components.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fplinker-rpc%2Fnginx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fplinker-rpc%2Fnginx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fplinker-rpc%2Fnginx/lists"}