Posted On: Oct 25, 2021

Amazon CloudFront now provides a CloudFront-Viewer-Address header that includes IP address and connection port information for requesting clients. The connection port field indicates the TCP source port used by the requesting client. Previously, IP address and client connection port information were available only in CloudFront access logs, making it harder to resolve issues or perform real-time decision-making based on these data. Now you can configure your CloudFront origin request policies to forward the CloudFront-Viewer-Address header to your origin servers. The header can also be used in CloudFront Functions when included in an origin request policy. The CloudFront-Viewer-Address header uses the following syntax: CloudFront-Viewer-Address:

The CloudFront-Viewer-Address header is provided at no additional cost. You can use the header, along with other CloudFront headers, for analyzing, auditing, and logging purposes. For more information about how to use the CloudFront-Viewer-Address header, see the CloudFront Developer Guide. Learn more about cache and origin request policies from our blog. To learn more about Amazon CloudFront, visit CloudFront product page.