- Newest
- Most votes
- Most comments
To forward JA3 and JA4 fingerprint headers to a Lambda function URL origin while ensuring the Host header is properly handled, you'll need to create a custom origin request policy. Here's how to approach this:
- Create a custom origin request policy that:
- Includes specific headers you want to forward (including CloudFront-Viewer-JA3-Fingerprint and CloudFront-Viewer-JA4-Fingerprint)
- Does NOT include the Host header in the list of headers to forward
When you create a custom origin request policy and specify only certain headers to forward (without including the Host header), CloudFront will:
- Forward only the headers you've specified
- Not forward the Host header from the viewer request
- Automatically set the Host header to the origin domain name (your Lambda function URL)
This approach allows you to:
- Get the JA3 and JA4 fingerprint headers at your Lambda function
- Ensure the Host header is set correctly for the Lambda function URL to work properly
Note that the JA3 and JA4 fingerprints are derived from the SSL/TLS Client Hello packet and are only present for HTTPS requests. These TLS-related headers can only be added to an origin request policy, not a cache policy.
Sources
Add CloudFront request headers - Amazon CloudFront
Configure Host header forwarding - AWS Elemental MediaTailor
Enhance your Security Posture and Reduce False Positives using Client JA3 Fingerprint and HTTP Header Order | Networking & Content Delivery
answered a year ago
Relevant content
asked a year ago

That does indeed answer the original question. However, I realize now I should have been clearer on what I want: I also want all of the headers from the client request to be included, e.g. Accept, Accept-Encoding, etc, etc. I can't allowlist every single header that can exist in HTTP.
Hi Alan,
I’ve been working on this exact scenario over the past few weeks and managed to solve it by combining a custom Origin Request Policy with a Lambda@Edge function.
The core issue is that when you enable a policy to forward all headers (including the original Host header) to a CloudFront origin like a Lambda Function URL or an S3 Bucket, the origin rejects the request because the Host header doesn't match its own domain.
Here is the step-by-step solution I implemented:
Why this works: The Lambda@Edge function intercepts the request after CloudFront has applied the origin request policy but before it reaches the origin. By swapping the viewer's Host for the origin's domainName, the origin (Lambda URL/S3/Custom Origin) accepts the request, yet your application still has access to the original JA3/JA4 fingerprints forwarded by CloudFront.
I hope this helps anyone facing the same challenge!