Iis – Amazon ELB not Passing “X-Forwarded-For” to IIS

amazon-elbhttp-headersiisx-forwarded-for

ELB is setup to accept public HTTPS (443) connections and send them on as HTTP (80) to the EC2 instances.

The EC2 instances run an IIS app that needs to know the user's IP address. According to everything I've read on this site and elsewhere, ELB is supposed to stash that information in a header named "X-Forwarded-For". For whatever reason, ELB doesn't seem to be passing that particular header to IIS (or IIS is stripping it out?).

Any idea what I could be doing wrong?

Best Answer

It sounds like you're using Layer 4 instead of layer 7. Change the front-end protocol (called 'load balancer protocol' in the console settings) from SSL(Secure TCP) to HTTPS (Secure HTTP).