View remote site via Traefik proxy

  docker, docker-compose, proxy, traefik, whatsapp

I want to have certain remote sites like https://web.whatsapp.com behind my own proxy on talk.mydomain.com. I want to do this using traefik v2 labels.

This is my docker-compose setup, but this does not work (404 page not found).

services:
  traefik:
    image: "traefik:v2.3"
    container_name: "traefik"
    environment:
      - AWS_ACCESS_KEY_ID=${TRAEFIK_AWS_ACCESS_KEY_ID}
      - AWS_SECRET_ACCESS_KEY=${TRAEFIK_AWS_SECRET_ACCESS_KEY}
      - AWS_REGION=${AWS_REGION}
      - AWS_HOSTED_ZONE_ID=${ROUTE53_HOSTED_ZONE_ID}
    command:
      - "--log=true"
      - "--global.sendAnonymousUsage=true"
      - "--providers.docker=true"
      - "--providers.docker.endpoint=unix:///var/run/docker.sock"
      - "--providers.docker.exposedbydefault=false"
      - "--entryPoints.http.address=:80"
      # - "--entrypoints.http.http.redirections.entryPoint.to=https"
      # - "--entrypoints.http.http.redirections.entryPoint.scheme=https"
      - "--entryPoints.https.address=:443"
      - "--entrypoints.https.http.tls.certResolver=dns-route53"
      - "--entrypoints.public.http.tls.certResolver=dns-route53"
      - "--entrypoints.https.http.tls.domains[0].main=*.${DOMAIN}"
      - "--certificatesresolvers.dns-route53.acme.dnsChallenge=true"
      - "--certificatesResolvers.dns-route53.acme.dnsChallenge.provider=route53"
      #- "--certificatesResolvers.dns-route53.acme.caServer=https://acme-staging-v02.api.letsencrypt.org/directory" # LetsEncrypt Staging Server
      - "[email protected]${DOMAIN}"
      - "--certificatesResolvers.dns-route53.acme.storage=/letsencrypt/acme.json"
      - "--certificatesResolvers.dns-route53.acme.dnsChallenge.delayBeforeCheck=60"
      - "--certificatesResolvers.dns-route53.acme.dnsChallenge.resolvers=1.1.1.1:53,1.0.0.1:53"
    security_opt:
      - no-new-privileges:true
    ports:
      - "80:80"
      - "443:443"
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.whatsapp.rule=Host(`talk.${DOMAIN}`)"
      - "traefik.http.routers.whatsapp.entryPoints=https"
      - "traefik.http.routers.whatsapp.service=whatsapp-srv"
      - "traefik.http.services.whatsapp-srv.loadbalancer.passHostHeader=true"
      - "traefik.http.services.whatsapp-srv.loadbalancer.server.url=https://web.whatsapp.com"

Is it possible to serve https://web.whatsapp.com via my own proxy and domain?

Source: Docker Questions

LEAVE A COMMENT