I cannot seem to get Nginx basic auth working from behind a Rackspace cloud balancer.
First I am using this code (it is also using real IP module here which was one of the mannny solutions I tried) within my nginx.conf:
http {
set_real_ip_from 1.1.1.2;
#real_ip_header X-Forwarded-For;
satisfy any;
allow 1.1.1.2;
deny all;
auth_basic "Restricted";
auth_basic_user_file /etc/nginx/htpasswd;
And this is the fields I see in my header within PHP:
["HTTP_X_FORWARDED_FOR"]=> string(14) "1.1.1.2"
And for some reason Nginx does not work on that by default.
I have tried quite a things but I cannot seem to get it to work.
Any ideas?
Just as I ask I actually find out why it is not working:
Says a list of IPs from which you trust the IP to set from, so I needed to put my load balancer IP into there and comment out the next line and now everything works.