How to get client ip from request using symfony in docker

  docker, ip, php, symfony

I try to get the ip using:

$request->getClientIp()

Which returns:

172.30.0.1 instead of something like 210.110.98.180

Using this something like this in docker-compose

http:
    build:
      context: .
      dockerfile: ./Dockerfile
    volumes:
      - "./:/var/www/http/"
    ports:
      - "80:80"

Source: Symfony Questions

LEAVE A COMMENT