Need to get clients IP address behind a Digital Ocean Load Balancer

Lukket Lagt ut 5 år siden Betales ved levering
Lukket Betales ved levering

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

Nettverksadministrasjon Nginx Node.js

Prosjekt-ID: #17093926

Om prosjektet

5 bud Eksternt prosjekt Aktiv 5 år siden

5 frilansere byr i gjennomsnitt $26 for denne jobben

ezbik

Hi. I got what you need and I am ready to help. I am familiar with Nginx & its custom rules. Regards.

$30 USD på 1 dag
(5 Omtaler)
3.4
nguyenhuukhoinw

Hello. Why you dont setup your own balancer, which will be easier for you to custom everything what you want?

$30 USD på 3 dager
(6 Omtaler)
2.7
vanchien

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

$15 USD på 1 dag
(0 Omtaler)
0.0