How to get client ip from request using symfony in docker

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

Was this helpful?

0 / 0

Leave a Reply 0

Your email address will not be published. Required fields are marked *