Hi
Yes, you can continue using most of your existing Nginx custom modules with OpenResty, but there are a few important points to keep in mind:
Key Considerations
OpenResty is basically Nginx + LuaJIT + bundled modules
OpenResty builds on the standard Nginx core, so most third-party Nginx modules will compile and work as long as they don’t conflict with bundled OpenResty modules.
Compatibility check
Some modules that rely on specific Nginx versions or patches may require slight adjustments.
Modules that touch internal Nginx data structures may break with OpenResty if the Nginx core has diverged.
Custom module compilation
OpenResty allows you to compile additional modules during the build process using --add-module.
Example:
./configure \
--with-compat \
--add-module=/path/to/your/custom/module
make
make install
--with-compat ensures compatibility for dynamically loaded modules.
Documentation References
Official OpenResty: Building OpenResty with Additional Nginx Modules
https://openresty.org/en/build.html
Dynamic Module Compatibility Guide
https://openresty.org/en/dynamic.html
Nginx Module Development Guide (for reference on building modules)
https://www.nginx.com/resources/wiki/extending/
Pro Tip
Test each custom module on a staging OpenResty build before migrating production.
If your module is small and mostly configuration-level, it usually works without changes.
If it’s deep core-level hooking, check the OpenResty GitHub repo for any known incompatibilities.