AWS Certified Developer – Associate — Question 67

A developer is writing an application to analyze the traffic to a fleet of Amazon EC2 instances. The EC2 instances run behind a public Application Load Balancer
(ALB). An HTTP server runs on each of the EC2 instances, logging all requests to a log file.
The developer wants to capture the client public IP addresses. The developer analyzes the log files and notices only the IP address of the ALB.
What must the developer do to capture the client public IP addresses in the log file?

Answer options

Correct answer: D

Explanation

The correct answer is D because including the X-Forwarded-For header in the log configuration allows the HTTP server to log the original client's IP address instead of the ALB's IP. Options A, B, and C do not address the issue of capturing the client's IP address; they either deal with headers unrelated to IP logging or involve additional services that do not solve the problem directly.