Need to get clients IP address behind a Digital Ocean Load Balancer
$10-30 USD
K zaplacení v momentě doručení
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
Identifikační číslo projektu: #17093926
O projektu
5 Freelnceři na tento projekt zveřejňují nabídky v průměru $26
Hi. I got what you need and I am ready to help. I am familiar with Nginx & its custom rules. Regards.
Hello. Why you dont setup your own balancer, which will be easier for you to custom everything what you want?
Hi in nginx configuration file. try to change $proxy_add_x_forwarded_for to $http_x_forwarded_for If it not work, contact me via Chat