For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
HUMAN DashboardHUMAN WebsiteRequest a Demo
Product GuidesEnforcer GuidesMobile SDKAPI ReferenceCustomer support
Product GuidesEnforcer GuidesMobile SDKAPI ReferenceCustomer support
  • General
    • About Enforcers
    • Support first-party HUMAN calls
    • Troubleshoot Enforcer configurations
  • Enforcer frameworks
    • Akamai ESI
    • Apache - C Module
    • ASP.NET
    • Callout Enforcer
    • Envoy Proxy
    • F5 BIGIP
    • Fastly JavaScript Compute@Edge
      • Fastly VCL changelog
        • Installing the Enforcer
        • GraphQL Support
        • Sensitive GraphQL Operations
        • Basic Configuration
        • Customized Subroutines
        • Additional Activity Handler
        • Advanced Blocking Response
        • Creating and Configuring the Edge-Dictionary
        • Custom CSS
        • Custom First Party Sensor Endpoint
        • Custom Logo
        • Custom JS Script
        • Custom Parameters
        • Filter Requests
        • Filter by HTTP Method
        • Filter by Route
        • Filter by Extension
        • Filter by IP
        • Filter by User Agent
        • Data Enrichment
        • First Party
        • First Party Snippet
        • Enforced Routes
        • Login Credentials Extraction
        • Modify First Party Response
        • Module Context Object
        • Module Enabled
        • Module Mode
        • Monitored Routes
        • Returning A Custom Block Page
        • Sensitive Routes
        • Test Block Flow on Monitoring Mode - Bypass Monitor Header
        • Upgrading the Enforcer
    • Google Cloud Platform (GCP) Callout Enforcer
    • Kong Plugin
    • NGINX - C Module
    • NGINX - LUA Module
    • PHP
    • Python
    • Ruby
    • Salesforce Commerce Cloud Cartridge
LogoLogo
Login
Login
HUMAN DashboardHUMAN WebsiteRequest a Demo
On this page
  • Filter by HTTP Method
Enforcer frameworksFastly VCLV9 and Below

Filter by HTTP Method

Was this page helpful?
Previous

Filter by Route

Next
Built with

Filter by HTTP Method

You can filter out requests based on an HTTP method. For example, to perform a health check, you may want to filter out requests that use theHEAD HTTP method.

TO define an HTTP method by which to filter out requests:

  1. Open thePX_CUSTOM.vcl file.
  2. Add the required HTTP method as a regex expression using req.request.

EXAMPLE

1sub px_custom_filter_by_http_method {
2if ((req.request ~ "(?i)(HEAD)$") {
3 set req.http.X-PX-filter-by:method = "1";
4 }
5}

To learn more about custom subroutines, see Customized subroutines.

TO enable the feature:

  1. Open the PX_CONFIG.vcl file.
  2. Set the px_filter_by_http_method_enabled value to “true” (enabled). The default is “false” (disabled).
1table px_configs {
2 "px_filter_by_http_method_enabled": "true",
3}
Test
  1. Send a request that includes one of the defined HTTP methods.
  2. Open the console and search for your request. If you can’t find the request, the feature is configured correctly.