First Party Configuration

First Party

First Party Mode enables the module to send/receive data to/from the sensor, acting as a reverse-proxy for client requests and sensor activities.

First Party Mode requires swapping the 3rd Party JS Snippet with the First Party JS Snippet.

  • By default the enforcer is configured to respond to First Party requests. One can confirm this by inspecting the HUMAN Lua Module configuration file: /usr/local/lib/lua/px/pxconfig.lua
1_M.first_party_enabled = true
  • If the HUMAN Lua module is enabled on location /, the routes are already open and no action is necessary.
    One can test that the endpoint is responding by browsing to domain.com/<PX_APP_ID without PX prefix>/init.js in which one will receive the First Party JS Sensor.
1server {
2 listen 80;
3
4 location / {
5 #----- PerimeterX protect location -----#
6 access_by_lua_block {
7 local pxconfig = require("px.pxconfig")
8 require("px.pxnginx").application(pxconfig)
9 }
10 #----- PerimeterX Module End -----#
11
12 root /nginx/www;
13 index index.html;
14 }
15}
  • If the HUMAN Lua module is NOT enabled on location / then he following routes must be configured within NGINX for First Party Mode to work:
1server {
2 listen 80;
3
4 location /<PX_APP_ID without PX prefix>/xhr/* {
5 #----- PerimeterX protect location -----#
6 access_by_lua_block {
7 local pxconfig = require("px.pxconfig")
8 require("px.pxnginx").application(pxconfig)
9 }
10 #----- PerimeterX Module End -----#
11 }
12
13 location /<PX_APP_ID without PX prefix>/init.js {
14 #----- PerimeterX protect location -----#
15 access_by_lua_block {
16 local pxconfig = require("px.pxconfig")
17 require("px.pxnginx").application(pxconfig)
18 }
19 #----- PerimeterX Module End -----#
20 }
21}

If your NGINX version supports HTTP v2, refer to the HTTP v2 section of the Appendix.

The HUMAN NGINX Lua Plugin configuration requirements must be completed before proceeding to the next stage of installation.