Lua + Redis is a nice way to do this, I have a small project
https://github.com/spro/simon that does dynamic routing and load balancing based on Hostname -> IP:Port sets in Redis. Adding a new route is as simple as:
sadd backends:hnapi.dev 192.168.0.42:10555