Skip to content

Traefik 2.0 on Docker Host Network; Router will redirect instead of reverse proxy #5471

@Ultradark

Description

@Ultradark

Do you want to request a feature or report a bug?

Bug

Did you try using a 1.7.x configuration for the version 2.0?

  • Yes
  • No

What did you do?

I configured reverse proxy Pritunl website using Traefik 2.0.

What did you expect to see?

Pritunl website loading correctly.

What did you see instead?

On client side, I am being redirected to localhost url (127.0.0.1:5400/login) instead of server url example.com/login. This is working correctly in Traefik 1.7 backends.

Output of traefik version: (What version of Traefik are you using?)

Version:      2.0.0
Codename:     montdor
Go version:   go1.13
Built:        2019-09-16T17:35:17Z
OS/Arch:      linux/amd64

What is your environment & configuration (arguments, toml, provider, platform, ...)?

servers.yml

http:
  routers:
    vpn:
      rule: "Host(example.net)"
      service: vpn
      tls: {}

  services:
    vpn:
      loadBalancer:
        servers:
        - url: "https://127.0.0.1:5400/"

Docker-Compose.yml

version: '3.3'

services:
  reverse-proxy:
    image: traefik:latest # The official Traefik docker image
    command: --providers.docker
    ports:
      - "80:80"     # The HTTP port
      - "443:443"   # The HTTPS port
      - "8080:8080"   # Dashboard port
    volumes:
      - "/var/run/docker.sock:/var/run/docker.sock" # So that Traefik can listen to the Docker events
      - "./traefik.yml:/traefik.yml"
      - "./acme.json:/acme.json"
      - "./servers.yml:/servers.yml"
    labels:
      - "traefik.enable=true"
    network_mode: host
    restart: always

traefik.yml

global:
  checkNewVersion: false
  sendAnonymousUsage: false
serversTransport:
  insecureSkipVerify: true
entryPoints:
  web:
    address: ":80"
  websecure:
    address: ":443"
  traefik:
    address: ":8080"
providers:
  docker:
    watch: true
    endpoint: "unix:///var/run/docker.sock"
    defaultRule: "Host(`example.net`)"
  file:
    watch: true
    filename: "/servers.yml"
api:
  insecure: true
  dashboard: true
  debug: false
certificatesResolvers:
  account:
    acme:
      email: "example@example.org"
      storage: "/acme.json"
      httpChallenge:
        entryPoint: web
      tlsChallenge: {}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions