Hello Jason,
I am a fellow programmer new to Openresty and Lua, although I'm more familiar to NGINX.
I began 6 weeks ago intending to create a specialized application server that would serve as a backend proxy end-point, as well handle significant load from http requests.
I have been extremely pleased with Openresty, although for the scale of my application, building a custom module in a "foreign" language has been daunting, but I think incredible considering my timeline.
Here are some notes on how I survived. Hope they help
1. From the page below you can get 2 things. I highly recommend Notepad++ for Windows. I also use Aptana Studio 3, which can organize my files but not achieve syntax checking and support for Lua. I do this because I develop primarily on Mac, but reference builds on Windows and Linux frequently within my network. Aptana glides between Mac/PC. You may not need it, although I consider Notepad++ indispensable.
NP++ has Lua support plus a whole lot more. If it isn't enabled by default you enable it in preferences as I have done with a multitude of (even more obscure) languages...
2. When developing my Module I was struggling to find a single resource that would list the "phases" of Nginx with correlations to Lua. I finally found this which helped bring several points together- hopefully you find it useful as well:
plus ngx_lua reference
I have more work to do to compile a single flowchart for my own purposes, but I may do this after my initial deadline and share it. Anyone else have a single resource like a flowchart to understand the phases?
3. Finally, there are a few Gotchas when coming from other programming environments. I am used to wiping my brain of syntax assumptions because I take on a lot of new languages, but I found this resource very helpful along with following best practices as outlined by the Lua man pages & other resources:
http://www.luafaq.org/gotchas.html
Hopefully these items help you get started.
Comments:
I have setup Openresty (nginx v.1.9.3) on Debian 8 (Jessie) with PostgreSQL 9.4. Without Openresty, I find it hard to get beyond Nginx 1.7 on Jessie. I have now built so quickly that I am now a raving fan of Lua and Openresty both.
In my development I had to try a few things before I got it right. I compiled lua-zlib module, and included libpng, and used some other modules for various aspects of my project thinking that these would work for me. For my custom app, I ended up using zlib and libpng as modules using the FFI bindings of LuaJIT so that I could use C-like code for my custom functions without requiring gd or imagick which would normally be used. Since I have a highly specialized app using custom created PNG's that do not require full featuresI felt like I needed a stripped-down interface to maximize speed where I could, particularly since using Postgres.
I feel as though I have developed a very robust app and the environment to support it in a very, very short period of time based on how it performs. I also wrangled with ngx_postgres and pgmoon - I prefer the latter to interface with postgres. Otherwise I have the custom Nginx conf that I've developed during the past few years to handle my infrastructure and make the dual backend/frontend of the app run smoothly, handling 10-20r/s.
--
regards,
bellasys