We have two Amazon EC2 instances, with a load balancer and a Django App. Amazon says the ELB is configured by default to send X-Forwarded-For headers to the Django App.
I’ve printed request.META and I see no HTTP_X_FORWARDED_FOR and when I do request.META.get('HTTP_X_FORWARDED_FOR'), I get None.
Is there a django configuration (we’re using 1.3 by the way), that I have to configure or set so that Django will read the Forwarded-For header?
Thanks,
Sam
After more investigation, we discovered that ELB was forwarding to port 443 on TCP and Apache was handling the SSL cert. In order to get ELB to forward X-Forwarded-For headers, it should be forwarding on HTTP, which also requires that the SSL Cert be installed on the ELB rather than on Apache. Hope this helps others