Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

199
Views
Traefik - Get the User IP

I have an Apache server that is behind Traefik. Now I want to get the user's IP, but I only get the container's internal IP.

I control all containers via a docker-compose file

docker-compose.yml:

app:
  image: traefik:1.7.20-alpine
  restart: always
  ports:
    - "MyIP:80:80"
    - "MyIP:443:443"
  volumes:
    - /var/run/docker.sock:/var/run/docker.sock:ro
    - ./traefik.toml:/traefik.toml
    - ./acme.json:/acme.json
  networks:
    - webserver

Apache-Server:
  build: ./apache/
  networks:
    - webserver
  labels:
    - "traefik.frontend.rule=Host:MyWebsite.tld"
    - "traefik.enable=true"
  links:
    - mysql:db
  volumes:
    - ./apache/public/:/var/www/html/:rw
  restart: always

Dockerfile:

FROM php:7.1-apache

RUN apt-get update && apt-get install -y --no-install-recommends apt-utils
RUN apt-get install libpng-dev -y
RUN docker-php-ext-install pdo_mysql
RUN docker-php-ext-install gd

How can I pass the real user IP?

over 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!