Lua with nginx

Openresty is an excellent piece of work that enables combining Lua scripting with the power of nginx, thereby giving you Lua as a server side scripting engine. Installing it is simple – just get the stable or latest version from the site, open it, ./configure, make and sudo make install.

On a clean Ubuntu, you will need to add the openssl and pcre libraries before doing the above so simply run:

sudo apt-get install libpcre3-dev
sudo apt-get install libssl-dev

and then follow the above steps.

Extensive documentation and sample snippets for openresty are available on the nginx site on the page for the HttpLuaModule

On a fresh Ubuntu, you might get all kinds of locale warnings or errors and get giberish when viewing foreign language files in the console – the solution:

sudo apt-get install language-pack-en-base
sudo dpkg-reconfigure locales

Leave a Reply

Your email address will not be published. Required fields are marked *