HUB
Sign inSign up
nginx-balancer logo

strm/nginx-balancer

By strm

•Updated about 9 years ago

Nginx as reverse proxy for load balancers !

Image
0

10K+

strm/nginx-balancer repository overview

⁠Simple NGinx Implementation for balancer (DEPRECATED)

Docker Pulls

This is a simple implementation of a balancer using NGinx and docker. See this repo⁠ for an example.

⁠Hosts

Hosts are passed using the environment variable NODES with a space between their values. The values are passed as host:port.

Print

⁠Implementing a load balancer

To illustrate this example, lets use the strm/helloworld-http for testing this image, create the following docker-compose.yml

version: '2'
services:
    front:
        image: strm/nginx-balancer
        container_name: load-balancer
        ports:
            - "80:8080"
        environment:
            - "NODES=web1:80 web2:80"
    web1:
        image: strm/helloworld-http
    web2:
        image: strm/helloworld-http
        

To run the image use the command:

docker-compose up

And you will see in the result that the balancer is working and balancing the request through images web1 and web2

Tag summary

Content type

Image

Digest

Size

71.5 MB

Last updated

about 9 years ago

docker pull strm/nginx-balancer