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

331
Vistas
Is there a way to pass the correct remote address to Nginx in a Docker container

I have a Nginx webserver that I'm running from inside a docker container. The problem I am having is that all client IP addresses in the nginx access.log are 172.19.0.1, the container's gateway. I would like the IP addresses shown to nginx to be the real IP addresses of the clients.

I've tried a few solutions that I found, including

  1. Using Nginx's realip module
    set_real_ip_from 172.19.0.1;
    real_ip_header X-Real-IP;
    real_ip_recursive on;

which still logged the gateway ip

  1. Setting the ports to host networking mode, which was ineffectual because I'm on macOS, and it is only supported on Linux.

The dockerfile I'm using looks like this

version: "3"
services:
    nginx:
        container_name: nginx
        ports:
            - target: 80
              published: 80
            - target: 443
              published: 443
        volumes:
            # [my volumes]
        restart: unless-stopped
        image: nginx
over 4 years ago · Santiago Trujillo
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