symfony-docker icon indicating copy to clipboard operation
symfony-docker copied to clipboard

trusted proxies and real ip

Open norkunas opened this issue 1 year ago • 3 comments

currently in compose.yaml there is:

TRUSTED_PROXIES: ${TRUSTED_PROXIES:-127.0.0.0/8,10.0.0.0/8,172.16.0.0/12,192.168.0.0/16}
TRUSTED_HOSTS: ^${SERVER_NAME:-example\.com|localhost}|php$$

ok so spin up for the localhost, my container has this:

docker inspect -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' www-php-1
172.21.0.1

but for some reason in Symfony $request->getClientIps() returns the container ip. what more configuration is needed?

norkunas avatar Feb 15 '24 04:02 norkunas