Accessing binary blob data in MySQL backend
csg
nginx-forum at nginx.us
Tue May 31 15:20:34 MSD 2011
Hi!
I am curious if is feasible to have Nginx deliver binary blob data which
is currently stored in a MySQL database. I was loosely following the
examples mentioned in agentzh's blog [1] which work all fine for me with
non-binary data. But as JSON is used for intermediate serialization
which is not binary safe I was wondering if there are other ways (or
even modules) that access the raw payload data from its RDS
representation.
In my scenario I'm trying to access images data like JPEGs stored as
blobs in MySQL causing the JSON parser to fail of course
content_by_lua aborted: runtime error: InvalidJSONInput: lexical error:
invalid bytes in UTF8 string.
My current software stack consists of CentOS 5.6/x86_64, Nignx 1.0.3
(plus simpl-ngx_devel_kit 0.2.17, chaoslawful-lua-nginx-module 0.1.5,
chaoslawful-drizzle-nginx-module 0.0.14, agentzh-rds-json-nginx-module
0.10), Lua 5.1.4, LuaRocks 2.0.4.1, Lua YAJL 2.0, YAJL 2.0.1, Drizzle7
libraries 2011.04.15 and MySQL database 5.1.57.
[1]
http://agentzh.blogspot.com/2011/02/ngxlua-v015-ability-to-capture-multiple_6605.html
Posted at Nginx Forum: http://forum.nginx.org/read.php?2,202577,202577#msg-202577
More information about the nginx
mailing list