Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

579
Vistas
nginx: how to get the actual client ip?

I have a simple express app. which is Dockerized. This is Repository.

I used nginx as a reverse proxy there. when I visit http://45.33.97.232:3000, it gives me the actual IP. But, when I visit http://45.33.97.232/, It gives me the same server IP. But I need actual Client IP here. And I am using Server IP in nginx config file. but I have a restriction, I can't write Server IP in nginx config file.

This is my nginx config file,

server {
    listen 80 default_server;
    server_name 45.33.97.232;
location / {
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_pass http://45.33.97.232:3000; #port where you are serving your express app.
  }
}
over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

In nginx if you want to pass through the IP address of the remote user to your backend web server you have to set X-Forwarded-For header to this remote ip, Like this:

proxy_set_header X-Forwarded-For $remote_addr;

and if you do not want to use server IP you can use the domain in your Nginx config file.

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda