{"id":23446679,"url":"https://github.com/erwinvaneyk/docker-nginx-lb","last_synced_at":"2026-05-09T10:11:57.243Z","repository":{"id":43737781,"uuid":"438207886","full_name":"erwinvaneyk/docker-nginx-lb","owner":"erwinvaneyk","description":"A minimal nginx-based load-balancer packaged in Docker","archived":false,"fork":false,"pushed_at":"2022-03-03T16:37:59.000Z","size":10,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-10T00:51:31.399Z","etag":null,"topics":["docker","load-balancer","nginx"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"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/erwinvaneyk.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}},"created_at":"2021-12-14T10:20:37.000Z","updated_at":"2022-02-03T10:45:38.000Z","dependencies_parsed_at":"2022-08-22T14:10:29.955Z","dependency_job_id":null,"html_url":"https://github.com/erwinvaneyk/docker-nginx-lb","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erwinvaneyk%2Fdocker-nginx-lb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erwinvaneyk%2Fdocker-nginx-lb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erwinvaneyk%2Fdocker-nginx-lb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erwinvaneyk%2Fdocker-nginx-lb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/erwinvaneyk","download_url":"https://codeload.github.com/erwinvaneyk/docker-nginx-lb/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248137997,"owners_count":21053775,"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":["docker","load-balancer","nginx"],"created_at":"2024-12-23T20:36:34.724Z","updated_at":"2026-05-09T10:11:52.213Z","avatar_url":"https://github.com/erwinvaneyk.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Docker-nginx-lb\n\nNginx-lb is an extremely simple nginx-based load-balancer packaged in a Docker \ncontainer. It accepts requests at specified port and distributes them over \none or more backend servers.\n\nIn effect this project is a lightweight wrapper (~23 MB) over the \n[nginx](https://hub.docker.com/_/nginx) Docker image (the `alpine` variant). \nIt is compatible with most options available present in those images.\n\nAlthough in most cases it is better to use the plain `nginx` image, there are a \ncouple of use cases where this image to create a load-balancer is useful:\n\n1. When prototyping, where you just want to quickly bring up a basic load-balancer;\n2. When working with a Docker environment that does not support volumes to mount a custom `nginx.conf`.\n\n## Usage\nTo proxy all requests to `example.com`:\n```shell\ndocker run --rm --name example-nginx-lb \\\n  -p 9090:9090 \\\n  -e LB_PORT=9090 \\\n  -e LB_BACKENDS=example.com:80 \\\n  erwinvaneyk/nginx-lb:latest\n```\n\nYou can use a simple curl command to see if it works:\n```shell\ncurl -H \"Host: example.com\" http://localhost:9090\n```\n\n## Configuration\nOn top of the configuration options of the plain `nginx` image, this image adds\nthe following configuration options:\n\n| Environment Variable | Description                                                   | Default      | Examples      |\n|----------------------|---------------------------------------------------------------|--------------|---------------|\n| `LB_PORT`            | The port the LB should accept requests on.                    | `80`         | `443`, `9090` |\n| `LB_BACKENDS`        | The server(s) to which the LB should distribute the requests, semicolon-separated. | `example.com:80` | `server1.example.com:3030;10.0.12.34:3031` |\n\n## Building\n\nTo build the Docker image yourself, you can use the plain Docker build workflow:\n\n```shell\ndocker build --tag erwinvaneyk/nginx-lb:latest .\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ferwinvaneyk%2Fdocker-nginx-lb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ferwinvaneyk%2Fdocker-nginx-lb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ferwinvaneyk%2Fdocker-nginx-lb/lists"}