In some cases you may need to define a prefix to the Enforcer's First-Party routes. The custom prefix must be defined both in the Enforcer's config file and in the PerimeterX console.
To define the First-Party Prefix:
- In your
pxconfig.lua
file, set the_M.first_party_prefix
property to the desired prefix value. For example:
_M.first_party_prefix = 'resources'
-
Open the PerimeterX Console.
-
Go to
Admin
->Applications
. -
Open the
Snippet
section. ActivateFirst-Party
(if not in First-Party already), and clickEdit
next to the Copy Snippet button. -
In the pop-up that opens there are two routes beginning with
/<appId without PX>
. Copy both routes to a side document to use in the next steps. -
Click
Advanced Configuration
. -
Under Sensor, copy the first route from step 5 and add the prefix you added in step 1 to the beginning of of the route.
For example:/resources/<appId without PX>/init.js
-
Under Server copy the second route from step 5 and the prefix you added in step 1 to the beginning of the route.
For example:/resources/<appId without PX>/xhr
-
Click
Save Changes
. -
Click
Copy Snippet
and update the JS Sensor snippet of your site with the updated one.