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

721
Vistas
GCP CLB: how to get X-Forwarded-For IP in Nginx.conf?

According GCP doc, https://cloud.google.com/load-balancing/docs/https#target-proxies, X-Forwarded-For contains multiple IPs, eg 1.2.3.4, 5.6.7.8, where 1.2.3.4 is the real client IP, 5.6.7.8 is the CLB IP.

How can I get 1.2.3.4 in nginx.conf? I want to use it with geoip.

over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

You can use the real IP module to break down X-Forwarded-For and set the $remote_addr variable with the proper value.

For example:

set_real_ip_from  5.6.7.8;
real_ip_header    X-Forwarded-For;
real_ip_recursive on;

The value of $remote_addr is changed from 5.6.7.8 to 1.2.3.4.

In many distributions of Nginx, this module is already present. Use nginx -V to confirm which modules are present.

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