Basics
- About the web interface controls
- Always-on DDoS mitigation
- Browser recommendations when using the Fastly web interface
- Content and its delivery
- Fastly POP locations
- Getting started with Fastly
- How caching and CDNs work
- How Fastly's CDN Service works
- HTTP status codes cached by default
- Self-provisioned Fastly services
- Sign up and create your first service
- Working with services
Domains & Origins
Performance
Basics
Dictionaries
Domains & Origins
- Changing origins based on user location
- Connecting to origins
- Enabling global POPs
- Failover configuration
- IPv6 support
- Maintaining separate HTTP and HTTPS requests to origin servers
- Routing assets to different origins
- Setting up redundant origin servers
- Specifying an override host
- Using Fastly with apex domains
Request settings
Cache settings
Headers
Responses
Performance
- About Dynamic Servers
- Cache control tutorial
- Caching configuration best practices
- Controlling caching
- Creating and using pools with Dynamic Servers
- Creating and using server entries with Dynamic Servers
- Enabling API caching
- Enabling automatic gzipping
- Failure modes with large files
- HTTP/2 server push
- Implementing API cache control
- Making query strings agnostic
- Request collapsing
- Segmented Caching
- Serving stale content
- Setting Surrogate-Key headers based on a URL
- Setting Surrogate-Key headers for Amazon S3 origins
- Streaming Miss
Purging
Custom VCL
- Accept-Language header VCL features
- Authenticating before returning a request
- Basic authentication
- Creating location-based tagging
- Custom responses that don't hit origin servers
- Delivering different content to different devices
- Enabling URL token validation
- Guide to VCL
- Isolating header values without regular expressions
- Manipulating the cache key
- IP geolocation variables: Migrating to the new dataset
- Overriding which IP address the geolocation features use
- Response Cookie handling
- Support for the Edge-Control header
- Understanding the different PASS action behaviors
- Using edge side includes (ESI)
- VCL regular expression cheat sheet
Image optimization
Video
Access Control Lists
Monitoring and testing
Securing communications
Security measures
TLS
- Domain validation for TLS certificates
- Enabling HSTS through Fastly
- Forcing a TLS redirect
- Managing domains on TLS certificates
- Serving HTTPS traffic using certificates you manage
- Serving HTTPS traffic using Fastly-managed certificates
- Setting up free TLS
- TLS key and certificate replacement
- TLS termination
Web Application Firewall
Logging endpoints
- Log streaming: Amazon S3
- Log streaming: Microsoft Azure Blob Storage
- Log streaming: Cloud Files
- Log streaming: Datadog
- Log streaming: DigitalOcean Spaces
- Log streaming: Elasticsearch
- Log streaming: FTP
- Log streaming: Google BigQuery
- Log streaming: Google Cloud Storage
- Log streaming: Honeycomb
- Log streaming: Kafka
- Log streaming: Log Shuttle
- Log streaming: LogDNA
- Log streaming: Logentries
- Log streaming: Loggly
- Log streaming: Heroku's Logplex
- Log streaming: OpenStack
- Log streaming: Papertrail
- Log streaming: Scalyr
- Log streaming: SFTP
- Log streaming: Splunk
- Log streaming: Sumo Logic
- Log streaming: Syslog
Non-Fastly services
Streaming logs
Debugging techniques
Common errors
Account management
Billing
User access and control
Isolating header values without regular expressions
Last updated August 09, 2018
Fastly supports the ability to extract header subfield values without regular expressions in a human-readable way. "Headers subfields" are headers with a body syntax style similar to value1=123value123; testValue=asdf_true; staff_user=true;
or max-age=0, surrogate-control=3600
These headers include Cookie, Set-Cookie, Cache-Control, or a custom header. Fastly allows you to isolate these key values with the following syntax:
1
req.http.Header-Name:key-name
For example, if a Set-Cookie
response from origin was value1=123value123; testValue=asdf_true; staff_user=true;
, you could isolate the staff_user
value using this logic:
1
beresp.http.Set-Cookie:staff_user
You can add this logic using VCL Snippets or using a custom header.
Using VCL Snippets
To execute this logic based on the value of staff_user
within req.http.Cookie
using a VCL Snippet, you would:
- Log in to the Fastly web interface and click the Configure link.
- From the service menu, select the appropriate service.
- Click the Edit configuration button and then select Clone active. The Domains page appears.
- Click the VCL Snippets link. The VCL Snippets page appears.
-
Click Create Snippet. The Create a VCL snippet page appears.
- In the Name field, type an appropriate name (e.g.,
Staff User Cookie
). - From the Type controls, select within subroutine.
- From the Select subroutine menu, select recv (vcl_recv).
-
In the VCL field, add the following condition:
1 2 3 4 5
# in vcl_recv if (req.http.Cookie:staff_user ~ "true") { # some logic goes here return(pass); }
- Click Create to create the snippet.
- Click the Activate button to deploy your configuration changes.
Using a custom header
You can isolate the value of staff_user
from Cookie
to the header req.http.staff_user
by creating a custom header with the following settings:
Fill out the Create a header fields as follows:
- In the Name field, type
Staff User Header
. - From the Type menu, select Request, and from the Action menu select Set.
- In the Destination field, type
http.staff_user
. - In the Source field, type
req.http.Cookie:staff_user
. - From the Ignore if set menu, select No.
- In the Priority field, type
10
.
This will send the staff_user
header in every inbound request.
NOTE: You can use the Attach a condition
link to only create this header when it's needed. See our Using Conditions docs for more information.