For instance, you could let nginx do this:
location /masukomi.txt {
default_type 'text/plain';
content_by_lua 'local tail = io.popen("tail -n 20 ".."/chroot/twtxt/masukomi.txt", "r")
for line in tail:lines() do
print(c, line)
end
';
}