Docker Community Forums

Share and learn in the Docker community.

Real IP in Docker Container


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

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
2 app2 service replicas -

Thats how i created these services