Hello, i am running docker rootless 27.5.1.
- i have traefik reverse proxy in a container and host is ubuntu server
- problem is every request that comes in my r proxy has the ip 172.18.0.1 which is that of docker router
How can i solve this i want to get real ip of client because i need it for middlewares in traefik but also without compromising security?
This is such a big problem online and i still didnt find a real solution to this.
Things i tried:
- macvelan network
- network mode host + publishing ports of container
- different configurations in traefik for getting info from headers.
Please ask me if you need more info from me.
docker-compose:
services:
reverse-proxy:
image: traefik:v3.3
restart: always
container_name: traefik
labels:
- traefik.enable=false # Prevents Traefik from discovering itself
ports:
- "80:80" # http
- "443:443" # https
- "8080:8080" # dashboard
volumes:
- /run/user/1000/docker.sock:/var/run/docker.sock
- ./conf/traefik_config/traefik.yml:/etc/traefik/traefik.yml
- ./conf/certs:/etc/traefik/certs
- ./conf/dynamic:/etc/traefik/dynamic/
- ./conf/letsencrypt/:/etc/letsencrypt/