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

Re: XML with nginx

$
0
0
You read the file into an array,

dsarr = {};
local file = io.open("file.txt", "r");
for i = 1, count, 1 do
ds_line = file:read();
table.insert (dsarr, ds_line);

And while reading you could parse the line or later parse the array.

Though at http://viremo.eludi.net/LuaXML/ is a good example of using a library and being able to get a value from a xml attribute, once you have a variable simple do something like "ngx.var.myprox = xmlvar;"
inside nginx you do then proxy_pass $myprox;

Viewing all articles
Browse latest Browse all 4759

Trending Articles



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