Hi Taylor,
I've successfully built nginx + lua-nginx-module + LuaJIT-dependencies entirely statically and it's not hard to do.
The problem is that the ffi references to the compiled functions are run-time not compile-time. As a result of this, the linker finds no references to the function and just leaves it out of the final binary (reducing it's size). The solution to this is to bracket the archive with the `-Wl,--whole-archive` and `-Wl,--no-whole-archive` options. (In your case something like `--with-ld-opt="/usr/local/lib/
resty_cjose.o -Wl,-E -Wl,--whole-archive /usr/local/lib/libcjose.a -Wl,--no-whole-archive"`). This forces the linker to include the entire archive into the final binary without removing any of its functions.
I really hope that helps you.