nerdexam
Amazon

DVA-C02 · Question #236

An application needs to use the IP address of the client in its processing. The application has been moved into AWS and has been placed behind an Application Load Balancer (ALB). However, all the clie

The correct answer is C. Alter the application code to inspect the X-Forwarded-For header. Ensure that the code can work. If you need to see external IP address and your app is behind ALB, always use x-forwarded-for. https://docs.aws.amazon.com/elasticloadbalancing/latest/application/x-forwarded-headers.html

Submitted by paula_co· Mar 5, 2026Development with AWS Services

Question

An application needs to use the IP address of the client in its processing. The application has been moved into AWS and has been placed behind an Application Load Balancer (ALB). However, all the client IP addresses now appear to be the same. The application must maintain the ability to scale horizontally. Based on this scenario, what is the MOST cost-effective solution to this problem?

Options

  • ARemove the application from the ALB. Delete the ALB and change Amazon Route 53 to direct
  • BRemove the application from the ALCreate a Classic Load Balancer in its place. Direct traffic to
  • CAlter the application code to inspect the X-Forwarded-For header. Ensure that the code can work
  • DAlter the application code to inspect a custom header. Alter the client code to pass the IP address

How the community answered

(50 responses)
  • A
    4% (2)
  • B
    8% (4)
  • C
    74% (37)
  • D
    14% (7)

Explanation

If you need to see external IP address and your app is behind ALB, always use x-forwarded-for. https://docs.aws.amazon.com/elasticloadbalancing/latest/application/x-forwarded-headers.html

Community Discussion

No community discussion yet for this question.

Full DVA-C02 Practice