body_filter_by_lua_block nginx lua -


the code below nginx lua:

body_filter_by_lua_block {     function check_access_file(file)         local fh = io.open(file,'rb')         if fh             fh:close()             return true         else             return false         end         return false     end        function write_file(file, str)         local check_access_file = check_access_file(file)         if check_access_file              local fh = io.open(file, "a")             fh:write(str, "\n")             fh:close()         end     end     write_file('/etc/nginx/111', '1234567='..ngx.arg[1]) } 

when run once, 2 replies written file

1234567 = test 1234567 = 

why each request 2 responses written file 111?


Comments

Popular posts from this blog

networking - Vagrant-provisioned VirtualBox VM is not reachable from Ubuntu host -

c# - ASP.NET Core - There is already an object named 'AspNetRoles' in the database -

ruby on rails - ArgumentError: Missing host to link to! Please provide the :host parameter, set default_url_options[:host], or set :only_path to true -