Upgrading the Enforcer

Upgrading from versions lower than 4.x

As of version 4.x the config builder was added. The config builder adds default values to properties that are not implicitly specified. This change requires the user to import the configuration in the init_worker_by_lua_block and access_by_lua_block blocks inside nginx.conf:

  1. Modify init_worker_by_lua_block
    Lua

    init_worker_by_lua_block {
        local pxconfig = require("px.pxconfig")
        require ("px.utils.pxtimer").application(pxconfig)
    }
    
  2. Modify access_by_lua_block
    Lua

    access_by_lua_block {
        local config = require('px.pxconfig')
        require("px.pxnginx").application(config)
    }
    
  3. Modify header_filter_by_lua_block
    Lua

    header_filter_by_lua_block {
        require("px.pxnginx").finalize()
    }
    

Upgrading from versions above 4.x

To upgrade to the latest Enforcer version, re-install the Enforcer according to your OS.