info
Sorry, we encountered an error while displaying this content. If you're a user, please try again later. If you're an administrator, take a look in your Flarum log files for more information.
agentzh
Hello!
On Mon, Jul 14, 2014 at 7:50 AM, info wrote:
> Can anyone improve this code as an alternative for the evil IF ?
[...]
> if ($mmode) { return 503; }
This "if" thing is equivalent to the following
rewrite_by_lua '
local v = ngx.var.mmode
if v and v ~= "" and v ~= "0" then
return ngx.exit(503)
end
';
And for your use case you can
1. merge the Lua code in set_by_lua into this rewrite_by_lua, and
2. eliminate the $mmode nginx variable altogether by your own Lua
variable (or even nothing).
Regards,
-agentzh
info
Sorry, we encountered an error while displaying this content. If you're a user, please try again later. If you're an administrator, take a look in your Flarum log files for more information.