For more information regarding the security incident at F5, the actions we are taking to address it, and our ongoing efforts to protect our customers, click here.

Forum Discussion

saintmichael's avatar
saintmichael
Icon for Nimbostratus rankNimbostratus
May 12, 2022

stuck on a spinner

I have a case of a very long running database query, and I need spinner to entertain  the users. But  I cannot figure it  out.

location /longtest {
default_type  'text/html; charset=UTF-8';
 content_by_lua_block {
                local h = io.popen('bash -c "/usr/sbin/longtest.sh"');
                if h then
                     local r = h:read("*a");
                     ngx.say(r);
                end
            }
}

I need to show a spinner until my query is ready to show the data. How would you accomplish this using nginx?