
Answer-first summary for fast verification
Answer: Include an X-Forwarded-For header in the HTTP server log configuration.
To capture the client public IP addresses in the logs of your HTTP server running on EC2 instances behind an Application Load Balancer (ALB), it is necessary to include the 'X-Forwarded-For' header in the HTTP server log configuration. The ALB adds this header to the incoming request, containing the original client's IP address, which allows the backend servers (EC2 instances) to log the IP address of the client making the request. Options A, B, and C do not address capturing the client's IP address correctly. Therefore, the correct answer is D.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
A developer needs to capture client public IP addresses in the logs of an HTTP server running on EC2 instances behind a public ALB. The current logs only show the ALB's IP address. What action should the developer take to resolve this?
A
Modify the HTTP server log configuration to include a Host header.
B
Deploy the Amazon CloudWatch Logs agent on EC2 instances for log file writing.
C
Deploy the AWS X-Ray daemon on EC2 instances for log file writing.
D
Include an X-Forwarded-For header in the HTTP server log configuration.
No comments yet.