Copy libvmod_px.so file to Varnish VMODS directory (this directory depends on Linux distribution: /usr/lib/varnish/vmods/ or /usr/lib64/varnish/vmods/).
In your configuration .vcl file:
import px;import std;Add the following lines to the sub vcl_init block to enable the Enforcer and provide the required parameters:
true to enable the Enforcer.Add the following section to the existing sub vcl_recv block. This section enables the Enforcer to process requests.
Add a new block named vcl_synth. This block displays a CAPTCHA if a request is blocked.
Add a new (or edit an existing) block named vcl_deliver. This block is executed when a response is sent back to a client.