lua-nginx-module
lua-nginx-module copied to clipboard
init_by_lua during Nginx config test
So the issue is well explained here init_by_lua is no longer run in Nginx config test??
I need this feature as well and I consider it to be very important for guaranteeing stability during Nginx reloads.
Here are some suggestions to be considered.
- Making running init_by_lua during "nginx -t" conditional by a directive
- Adding a new phase like config_test_by_lua therefore seperating it from init_by_lua, so resolving the reason why this feature was removed in the first place.
https://github.com/openresty/lua-nginx-module/pull/1377#issuecomment-420604831 Maybe you can use this way.
The init_by_lua is disabled during nginx -t and nginx -s because complex OpenResty APP will have much logic in the init_by_lua.
#1377 (comment) Maybe you can use this way.
Thank you, it is certainly a valid workaround, however harder for me to implement in my current setup (hundreds of servers). With the current openresty toolset, it's easier for me to track reload failures and manually check error.log. If possible in the future config_test_by_lua_block kind of extra phase would be very meaningful for the usage cases of openresty.