ThetaNil

Fully Static OpenResty + LuaJIT + SQLite (No OpenSSL)
Login

Fully Static OpenResty + LuaJIT + SQLite (No OpenSSL)

Objective

Build a single, fully static OpenResty binary on Linux that includes:

The result should be portable, minimal, and deployable in environments without external dependencies.

Prerequisites

Build Environment

Required Sources

Note: Exclude OpenSSL and any SSL-related modules.

High-Level Build Steps

1) Prepare Sources

Download, extract, and organize sources for OpenResty, LuaJIT, SQLite, PCRE, and zlib.

2) Build Static Dependencies

3) Configure OpenResty

4) Customize Nginx Modules

5) Adjust Linker Flags

6) Compile OpenResty

7) Integrate SQLite Access

8) Testing

Detailed Considerations

LuaJIT Integration

SQLite Integration

Dependency Management

Nginx Module Selection

Include minimal modules for:

Exclude:

Build Validation

Confirm the final binary is fully static:

Test SQLite:

Test HTTP server:

Outcome