You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Have problem while getting user real IP - it always shows as container ip.
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
So based on requested host i redirect to appropriate docker service.
Problem is - in nginx logs and in php application client IP shows as gateway container IPs e.g. 10.255.0.7
Any ideas how can I restore original client ip if i use docker loadbalancing?
implemented purely through routing and firewall rules; and so
without the need for running any additional application layers like traefik or other reverse proxies; and so
there's no need to reconfigure your existing application.
As far as I know, the docker-ingress-routing-daemon is the most lightweight way to access client IPs from within containers launched by docker services.
Summary of features:
Support for replacing docker's masquerading with routing on incoming traffic either for all published services, or only for specified services on specified TCP or UDP ports
Support for recent kernels (such as employed in Google Cloud images) that set rp_filter=1 (strict) inside service containers
Automatic installation of kernel tweaks that improve IPVS performance in production (though this can be disabled)
Please check it out and raise any issues you find.
Have problem while getting user real IP - it always shows as container ip.
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
Ingress network:
docker network create --driver overlay ingress
Gateway nginx config looks something like this:
So based on requested host i redirect to appropriate docker service.
Problem is - in nginx logs and in php application client IP shows as gateway container IPs e.g. 10.255.0.7
Any ideas how can I restore original client ip if i use docker loadbalancing?
Docker version 1.12.1, build 23cf638
The text was updated successfully, but these errors were encountered: