I have configured:
- ngx_lua as rewrite_by_lua_file
- lua returns upstream
- Nginx connects to the upstream
The question is how can I archive proxy_next_upstream.
Preferably I would like to return to lua with a error reason.
If the only way is to return several servers in upstream from lua, how
do so ?
I’m currently setting ngx.var.upstream and then proxy_pass
I suppose the simplest method would be to set the $upstream in correct
format. But what about my preferably method?