Need to get clients IP address behind a Digital Ocean Load Balancer
$10-30 USD
Closed
Posted almost 6 years ago
$10-30 USD
Paid on delivery
Hi all
I used to have a setup as follows:
Client visits web site -> Nginx -> Node script
The node script was able to successfully get the Client's real IP address via an nginx config similar to the example below:
location / {
proxy_pass http://localhost:8080;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
And as follows in the node script:
var ip = [login to view URL]['x-forwarded-for']
I have changed the setup as follows:
Client visits web site -> Digital Ocean Load Balancer -> Nginx -> Node script
Using the same configuration as above, the node script now gets the Digital Ocean Load Balancer IP address. I need to change this so I can once again get the IP address of the client.
The Digital Ocean Load Balancer forwarding rule I am using is as follows:
HTTPS/443 (Load Balancer) -> Passthrough -> HTTPS/443 (Droplet).
I need you to tell me what I need to change to get this to work.
I will make the changes. I just need you to give me the steps to follow.
Any questions please ask.
Thanks