# Reverse proxy to external host

**URL:** <https://community.traefik.io/t/reverse-proxy-to-external-host/3615>\
**Category:** Traefik v2\
**Tags:** docker\
**Created:** [December 29, 2019, 12:25pm UTC](https://community.traefik.io/t/reverse-proxy-to-external-host/3615 "2019-12-29T12:25:34Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![ldez](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/ldez/32/5_2.png) [@ldez](https://community.traefik.io/u/ldez)\
**Post date:** [December 29, 2019, 4:08pm UTC](https://community.traefik.io/t/reverse-proxy-to-external-host/3615/4 "2019-12-29T16:08:22Z")

</div>

```auto
version: "3.7"

services:
  traefik:
    image: traefik:v2.1.1
    command: >
      --log.level=INFO
      --api
      --providers.docker.exposedbydefault=false
      --providers.file.directory=/dynamic/
      --entrypoints.web.address=:80
      --entrypoints.websecure.address=:443
    ports:
      - 80:80
      - 443:443
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
      - ./dynamic/:/dynamic/
    labels:
      # enable this service
      traefik.enable: true

      # dashboard
      traefik.http.routers.api.rule: Host(`traefik.localhost`)
      traefik.http.routers.api.entrypoints: web
      traefik.http.routers.api.service: api@internal

```

`./dynamic/mytraefikhost.yml`

```auto
http:
  routers:
    foobar:
      entryPoints:
      - websecure
      middlewares:
      - strip
      service: myexthost
      rule: Host(`dev.mytraefikhost.de`) && Path(`/myexthost/www`)
      tls: {}

  myexthost:
    foobar:
      loadBalancer:
        servers:
        - url: https://www.myexthost.de
 
  middlewares:
    strip:
      stripPrefix:
        prefixes:
        - /myexthost/www

```

---

_[View the full topic](https://community.traefik.io/t/reverse-proxy-to-external-host/3615)._
