traefik some note

php real ip issue:

Use $_SERVER[‘HTTP_X_FORWARDED_FOR’] instead of $_SERVER[‘REMOTE_ADDR’] for php if using traefik as loadbalancer, or 172.X.X.X internal IP is return rather than real ip


http redirect

if need http→https

https://stackoverflow.com/questions/60510232/how-can-i-redirect-http-to-https-using-traefik

put this label under traefik service in docker compose and remember set traefik.enable=true


dashboard:

if you want the dashboard, see this:

https://gist.github.com/Maescool/7ec9836c48e53de79cc51fb70fbe1388