I am trying to see if I can get nginx (OSS, not commercial) to act as a dynamic router/switch in the event that I need to shut my app down and redirect traffic to a CDN/static page, etc. I was hoping to find a REST API that might allow me to configure routing rules on the fly but alas, I see nothing in nginx core. Someone on StackOverflow pointed me to this community's nginx/Lua module.Does this module provide such a REST API? Basically I'm looking to configure nginx such that it normally balances all traffic between, say, myapp01.example.org and myapp02.example.org. However, I'd like to be able to hit a REST endpoint on the nginx balancer (say, POST /switch/offline, etc.) and now all traffic is redirected to, say, mycdn.example.org. When I'm ready to bring my app back up, I hit POST /switch/online and now nginx resumes load balancing between my two main app nodes.
Is this possible to do with your module? If so, what would the config/setup look like? Thanks for any and all help!