Created
April 25, 2020 11:28
-
-
Save anilsakr/425954517bb49ad5ff070f7974639877 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
location /sumdemo { | |
set $diff ''; # we have to predefine the $diff variable here | |
set_by_lua $sum ' | |
local a = 32 | |
local b = 56 | |
ngx.var.diff = a - b; -- write to $diff directly | |
return a + b; -- return the $sum value normally | |
'; | |
echo "sum = $sum, diff = $diff"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment