It is an openresty implementation of the Rainbond platform load balancer, and exists as a plug-in for the Rainbond Entrance.
But it is universal, any place that uses Nginx as load balancing may use it instead, you can dynamically modify its configuration through the Restful API.
Currently supported operations include: post, update, get and delete of upstreams, server and stream servers. This means that it supports both L7 and L4 load balancing.
Clone it first to your local.
If you need to access this nginx by domain name, modify the HTTP_SUFFIX_URL
environment variable in the Dockerfile.
./build.sh
./run.sh
curl 127.0.0.1:10002/health
test/unit-tester.sh
json='{"name": "app1", "servers": [{"addr":"127.0.0.1:8088", "weight": 5}, {"addr":"127.0.0.1:8089", "weight": 5}]}'
curl 127.0.0.1:10002/v1/upstreams/app1 -X POST -d "$json"
json='{"name": "app1", "domain": "myapp.sycki.com", "port": 8085, "path": "/", "protocol": "http", "toHTTPS": "false", "cert": "this_cert_content...", "key": "this_key_content...", "options": {}, "upstream": "app1"}'
curl 127.0.0.1:10002/v1/servers/app1 -X POST -d "$json"
curl 127.0.0.1:10002/v1/servers/app1 -X DELETE -d '{"protocol": "http"}'
curl 127.0.0.1:10002/v1/upstreams/app1 -X DELETE
- More usage View unit test file unit test script
- OpenResty project