traefik in front of privoxy

Hello,
I have set up a privoxy service, which works well as an http proxy, when mapping the exposed port 8118 directly to the host.

Now I wanted to put traefik in front of it to get easy TLS, authentication etc. the like I have been using successfully for a dozen of other services before.

BUT: traefik keeps returning a 404 all the time, no matter what I try

What do I miss here? Can traefik be used in front of another http proxy at all? Does it need some special config? Is there any difference to putting it in front of a “normal” web app?

Here is my traefik docker-compose.yml

services:

  traefik:
  
    image: "traefik:latest"
    
    restart: always

    command:
      - "--log.level=INFO"
      - "--api.insecure=false" # disable traefik /dashboard and /api

      - "--providers.docker=true"
      - "--providers.docker.exposedbydefault=false"

      - "--entrypoints.web.address=:80"
      - "--entrypoints.web.http.redirections.entrypoint.to=websecure"
      - "--entrypoints.web.http.redirections.entrypoint.scheme=https"

      - "--entrypoints.websecure.address=:443"

      - "--certificatesresolvers.myresolver.acme.tlschallenge=true"
      - "--certificatesresolvers.myresolver.acme.email=webmaster@somedomain.com"
      - "--certificatesresolvers.myresolver.acme.storage=/letsencrypt/acme.json"
      
      #- "--tls.options.default.sniStrict=true"

  
    ports:
      - "1.2.3.4:80:80"   # needed for redirect to :443 only!
      - "1.2.3.4:443:443" # secure connection
    volumes:
      - "./conf/letsencrypt:/letsencrypt"
      - "./conf/basicauth:/basicauth"
      - "/var/run/docker.sock:/var/run/docker.sock:ro"
    networks:
      - shared-net
        
networks:
  shared-net:
    driver: bridge

… and this is the privoxy docker-compose.yml

services:

    privoxy-http_app:
    
        build:
          context: ./build/privoxy
          dockerfile: ./Dockerfile        
        restart: unless-stopped

        labels:
         - "traefik.enable=true"
         - "traefik.http.routers.proxyhttp.rule=Host(`proxy.somedomain.com`)"
         - "traefik.http.routers.proxyhttp.entrypoints=websecure"
         - "traefik.http.routers.proxyhttp.tls.certresolver=myresolver"  
		 # explicitly provide the port to forward to 
         - "traefik.http.routers.proxyhttp.service=privoxy-http_app"
         - "traefik.http.services.privoxy-http_app.loadbalancer.server.port=8118"
         # make sure traefik uses the right network!
         - "traefik.docker.network=traefik_shared-net" 

        volumes:
          - ./conf/privoxy-http.conf:/etc/privoxy/config
         
        networks:
          - traefik_shared-net      
          
networks:

    traefik_shared-net:
        external: true 

Maybe enable Traefik debug log (doc) and Traefik access log in JSON format (doc) for further insights. JSON access log will tell you if the target service or Traefik itself was responding with 404.