Hey!
I have had a weird problem with my lua code. My code buffers entire webpage, inserts a few lines inside buffered html and then returns the page.
As a user I can see those added lines, or not, depending on the configuration. I set $doJob variable inside the conf file and then check "if ngx.var.doJob then ... end" in my lua code to determine whether I need to insert special string.
Beside this there are some constant strings which I insert regardless of configuration - like an additional tag next to the </head>.
This has worked without issues for a few weeks. Yesterday I checked on my site and spotted that after I enter the website and see the everything as it supposed to be, I refresh the page and see that the "doJob" lines were not inserted, but the general ones were. I have observed this issue a few more times, but the issue resolved itself and didn't happen since and I'm unable to reproduce it in my test enviroment.
nginx logs show no errors(set to debug level)
My server sits on Rackspace, on a basic Debian 8, nginx is compiled with the ngx-lua module, luajit compiler.
Coincidentally rackspace had, quote, a "networking issue that ... is affecting servicenet connectivity".
I understand the problem was that ngx variables were somehow ignored or lost their values.
So my question is - what could have affected nginx variables? Is this behavior known, encountered by anyone before?
Apologies for the theoretical question.
Any input appreciated!