Currently, Nginx only supports one
init_by_lua_file, which is used by the Signal Sciences Nginx
module. If you have your own Lua scripts embedded within Nginx, you
will need to splice the Signal Sciences module into your custom Lua
Note: By not using the
sigsci.confconfiguration file, you will not receive configuration file updates when the module is upgraded. You should take care and review your Lua module when a Signal Sciences module release is updated.
Removing the Signal Sciences Nginx Lua Module
Before you add our module into your existing Lua code, you’ll need to
remove any references to the
sigsci include file: Look for and remove
any lines that look like:
Next, the following should be added to your Nginx configuration:
lua_shared_dict sigsci_conf 12k; lua_use_default_type off;
init_by_lua or the file specified by
include the following snippet:
package.path = "/opt/sigsci/nginx/?.lua;" .. package.path sigsci = require("SignalSciences")
Lastly, you will need to add an
your Nginx configuration. If you already have these directives
defined, copy the
sigsci.postrequest() statements to their respective Lua callers.
access_by_lua 'sigsci.prerequest()'; log_by_lua 'sigsci.postrequest()';
After adding those lines to your custom Lua scripts, restart Nginx.