sd8fda
Last Updated: February 25, 2016
·
6.892K
· bartlomiejdanek
Bard2

AWS ELB + nginx real IP address

Just add following lines into your Nginx configuration in http section.

real_ip_header     X-Forwarded-For;
set_real_ip_from   0.0.0.0/0;
Say Thanks
Respond

3 Responses
Add your response

7728
1d82e386d186e265b5a737752c5872a1

Also.. welcome in some fun security exploits.

over 1 year ago ·
7733
Bard2

@whardier, do you know better solution?

over 1 year ago ·
8591
5c1252cee710e2cec785ec999a130fe6

I think

real_ip_header     X-Forwarded-For;
set_real_ip_from   10.0.0.0/8;
set_real_ip_from   172.16.0.0/12;
set_real_ip_from   192.168.0.0/16;
real_ip_recursive on;

(realiprecursive because the ELB might bounce the traffic off more than 1 IP)

And now you can limit the port to a security group of the ELB so noone else can hit it anyway.

over 1 year ago ·