Quantcast
Channel: Nginx Forum - How to...
Viewing all articles
Browse latest Browse all 4759

XML problem with refresh page

$
0
0
Hello, I use Lua code for XML file but I get problem ( error 500 ) when I try to get more then once some atribute.

here is a my code :

rewrite_by_lua '
require("LuaXml")
local xfile = xml.load("test.xml")
local xscene = xfile:find("scene")
ngx.say(xscene.id)
';

First time work fine, but next time when I going to refreshing location I get error :

lua entry thread aborted: runtime error: rewrite_by_lua(nginx.conf:41):3: attempt to index global 'xml' (a nil value)
stack traceback:
coroutine 0:
rewrite_by_lua(nginx.conf:41):3: in function <rewrite_by_lua(nginx.conf:41):1>, client: 127.0.0.1, server: localhost, request: "GET /testlua HTTP/1.1", host: "127.0.0.1:8080"

Please help me to resolve this problem !

Viewing all articles
Browse latest Browse all 4759

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>