Docker Community Forums

Share and learn in the Docker community.

Real IP in Docker Container

Hello,

i have a major problem with docker. i am running several php applications in docker container on a remote server (debian 10) in production.

one of my applications relys on the clients ip address ( _SERVE['REMOTE_ADDR'] ) but i have no chance to pass the clients real ip address to my dockerized application. The _SERVE[‘REMOTE_ADDR’] is always the gateway address of my docker network… something like 172.19.0.1.

is this even possible to achieve?

thank you!

Im using docker 1.12 in swarm mode, 3 services with 2 replicas each.
2 gateway service replicas - whic dontains nginx and forward requests based on host
2 app1 service replicas - lets call it app1.example.com
2 app2 service replicas - app2.example.com

Thats how i created these services