{"id":21175522,"url":"https://github.com/capcom6/nginx-controller","last_synced_at":"2026-05-09T20:08:48.091Z","repository":{"id":200799019,"uuid":"703128798","full_name":"capcom6/nginx-controller","owner":"capcom6","description":"Nginx Controller is a REST API service for managing and configuring an Nginx reverse-proxy.","archived":false,"fork":false,"pushed_at":"2025-01-14T03:05:32.000Z","size":705,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-21T11:28:09.002Z","etag":null,"topics":["api","controller","nginx","nginx-configuration","nginx-proxy"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":false,"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/capcom6.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":"2023-10-10T16:42:25.000Z","updated_at":"2025-01-14T03:05:36.000Z","dependencies_parsed_at":null,"dependency_job_id":"38e817d0-aafc-4f44-968b-7386d4e99a24","html_url":"https://github.com/capcom6/nginx-controller","commit_stats":null,"previous_names":["capcom6/nginx-controller"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/capcom6%2Fnginx-controller","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/capcom6%2Fnginx-controller/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/capcom6%2Fnginx-controller/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/capcom6%2Fnginx-controller/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/capcom6","download_url":"https://codeload.github.com/capcom6/nginx-controller/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243624090,"owners_count":20321029,"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":["api","controller","nginx","nginx-configuration","nginx-proxy"],"created_at":"2024-11-20T16:59:46.889Z","updated_at":"2026-05-09T20:08:48.053Z","avatar_url":"https://github.com/capcom6.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Nginx Controller\n\n[![License](https://img.shields.io/badge/license-Apache%202.0-blue)](LICENSE)\n\nNginx Controller is a service that allows you to control the configuration of an Nginx reverse-proxy through a JSON REST API. It provides endpoints to add new virtual hosts with multiple upstreams, generate Nginx configuration files based on templates, and reload Nginx to apply the changes.\n\n## Table of contents\n\n- [Nginx Controller](#nginx-controller)\n  - [Table of contents](#table-of-contents)\n  - [Features](#features)\n  - [Getting Started](#getting-started)\n    - [Prerequisites](#prerequisites)\n    - [Quickstart](#quickstart)\n  - [Usage](#usage)\n    - [Configuration](#configuration)\n    - [API](#api)\n    - [Security](#security)\n  - [Roadmap](#roadmap)\n  - [Contributing](#contributing)\n  - [License](#license)\n\n\n## Features\n\n- Add new virtual hosts with multiple upstreams\n- Generate Nginx configuration files based on templates\n- Reload Nginx to apply the configuration changes\n- Remove virtual hosts from the configuration\n\n## Getting Started\n\n### Prerequisites\n\n- Go 1.20 or higher\n- Nginx installed on the system\n\n### Quickstart\n\n1. Clone the repository:\n\n   ```shell\n   git clone https://github.com/capcom6/nginx-controller.git\n   ```\n2. Change to the project directory:\n   ```shell\n   cd nginx-reverse-proxy-controller\n   ```\n3. Build the project:\n   ```shell\n   make build\n   ```\n4. Copy and edit example `config.yaml`:\n   ```shell\n   cp configs/config.example.yaml config.yaml\n   vi config.yaml\n   ```\n5. Run the project:\n   ```shell\n   ./nginx-controller\n   ```\n6. Create first virtual host:\n   ```\n   curl http://localhost:3000/api/v1/hosts/example.local -X PUT -H \"Content-Type: application/json\" -d '{ \\\n        \"upstream\": [ \\\n            { \\\n                \"host\": \"example.com\", \\\n                \"port\": 80, \\\n                \"weight\": 1 \\\n            } \\\n        ] \\\n   }'\n   ```\n\n## Usage\n\n### Configuration\n\nThe configuration file is stored in the `config.yaml` file. The file is a YAML document that describes the configuration of the controller. The following is an example of a valid configuration file:\n\n```yaml\n---\n# nginx-related configuration\nnginx:\n    location: /etc/nginx/conf.d/ # where to put virtual hosts configs\n    template:\n        | # template for virtual host configs, seet `text/template` package description for syntax\n        upstream {{ .UpstreamName }} {\n            {{ range $server := .Servers }}\n                server {{ $server.Host }}:{{ $server.Port }} {{ $server.Options }};\n            {{ end }}\n        }\n\n        server {\n\n            listen 80;\n            server_name {{ .DomainName }};\n\n            location / {\n                proxy_pass http://{{ .UpstreamName }};\n\n                include    proxy.conf;\n            }\n        }\n```\n\nBy default the controller uses `config.yaml` file in local directory. You can change the configuration file location by setting the environment variable `CONFIG_PATH` to a custom path.\n\n### API\n\nYou can find controller API documentation in OpenAPI format [here](./api/swagger.yaml). Some examples available in [requests.http](./api/requests.http) file.\n\n### Security\n\nThe application does not include any built-in authorization or authentication mechanism. To enhance security, it is recommended to use an external service or tool, such as Nginx, to provide basic authentication and restrict access to the application. Alternatively, deploying the application in a private network can provide an additional layer of security and help prevent unauthorized access from external sources.\n\n## Roadmap\n\n- **TLS/SSL support:** Add support for managing TLS/SSL certificates and configuring HTTPS virtual hosts.\n- **Configuration validation:** Add validation checks to ensure that the generated Nginx configuration files are valid and error-free.\n- **Web-based administration interface:** Develop a web-based interface for managing virtual hosts and upstreams, providing a user-friendly alternative to the API.\n\n## Contributing\n\nContributions are welcome! If you find any issues or have suggestions for improvement, please open an issue or submit a pull request.\n\n## License\n\nThis project is licensed under the Apache License 2.0. See the LICENSE file for details.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcapcom6%2Fnginx-controller","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcapcom6%2Fnginx-controller","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcapcom6%2Fnginx-controller/lists"}