# Simple Proxy Config

**URL:** <https://community.traefik.io/t/simple-proxy-config/4969>\
**Category:** Traefik v2\
**Tags:** docker\
**Created:** [March 17, 2020, 7:35pm UTC](https://community.traefik.io/t/simple-proxy-config/4969 "2020-03-17T19:35:27Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jeffreywfinch](https://avatars.discourse-cdn.com/v4/letter/j/a88e4f/32.png) [@jeffreywfinch](https://community.traefik.io/u/jeffreywfinch)\
**Post date:** [March 17, 2020, 7:35pm UTC](https://community.traefik.io/t/simple-proxy-config/4969/1 "2020-03-17T19:35:27Z")

</div>

I'm using Traefix 2.x in docker container. I would like to setup a dozen or so simple static conversions. For Example:  
[Host1.domain.com:80](http://Host1.domain.com:80) -\> 192.168.0.10:8080  
[Host1.domain.com:90](http://Host1.domain.com:90) -\> 192.168.0.10:8090  
[Host2.domain.com:80](http://Host2.domain.com:80) -\> 192.168.0.10:9090  
[Host4.domain.com:80](http://Host4.domain.com:80) -\> 192.168.0.11:8080\admin

---

<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:** [March 17, 2020, 8:19pm UTC](https://community.traefik.io/t/simple-proxy-config/4969/2 "2020-03-17T20:19:25Z")

</div>

Hello,

Do you have a problem, a question? How we can help you?

---

<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:** [March 17, 2020, 8:48pm UTC](https://community.traefik.io/t/simple-proxy-config/4969/3 "2020-03-17T20:48:12Z")

</div>

> **docker-compose.yml**
>
> ```auto
> version: "3.7"
> 
> services:
> traefik:
> image: traefik:v2.1.6
> ports:
> - "80:80"
> - "90:90"
> - "8080:8080"
> command:
> # https://docs.traefik.io/v2.1/operations/api/#insecure
> - --api.insecure
> 
> # https://docs.traefik.io/v2.1/routing/entrypoints/
> - --entryPoints.web.address=:80
> - --entryPoints.foo.address=:90
>       
> # https://docs.traefik.io/v2.1/providers/file/
> - --providers.file.directory=/conf/
> - --providers.file.watch=true
> volumes:
> - /var/run/docker.sock:/var/run/docker.sock
> - ./conf/:/conf/
> 
> ```

  

> **/conf/dyn.yml**
>
> ```auto
> 
> # https://docs.traefik.io/v2.1/routing/overview/
> 
> http:
> # https://docs.traefik.io/v2.1/routing/routers/#configuring-http-routers
> routers:
> 
> host1:
> rule: Host(`host1.domain.com`)
> entryPoints:
> - web
> service: host1_svc
> 
> host1_foo:
> rule: Host(`host1.domain.com`)
> entryPoints:
> - foo
> service: host1_foo_svc
> 
> host2:
> rule: Host(`host2.domain.com`)
> entryPoints:
> - web
> service: host2_svc
> 
> host4:
> rule: Host(`host4.domain.com`)
> entryPoints:
> - web
> service: host4_svc
> middlewares:
> - add_admin
> 
> # https://docs.traefik.io/v2.1/routing/services/#configuring-http-services
> services:
> 
> host1_svc:
> loadBalancer:
> servers:
> - url: 192.168.0.10:8080
> 
> host1_foo_svc:
> loadBalancer:
> servers:
> - url: 192.168.0.10:8090
> 
> host2_svc:
> loadBalancer:
> servers:
> - url: 192.168.0.10:9090
> 
> host4_svc:
> loadBalancer:
> servers:
> - url: 192.168.0.11:8080
> 
> # https://docs.traefik.io/v2.1/middlewares/overview/
> middlewares:
> # https://docs.traefik.io/v2.1/middlewares/addprefix/
> add_admin:
> addPrefix:
> prefix: /admin
> 
> ```

  

Documentation:

- [https://docs.traefik.io/v2.1/getting-started/concepts/](https://docs.traefik.io/v2.1/getting-started/concepts/)
- [https://docs.traefik.io/v2.1/getting-started/quick-start/](https://docs.traefik.io/v2.1/getting-started/quick-start/)
- [https://docs.traefik.io/v2.1/getting-started/configuration-overview/](https://docs.traefik.io/v2.1/getting-started/configuration-overview/)
- [https://docs.traefik.io/v2.1/providers/file/](https://docs.traefik.io/v2.1/providers/file/)
- [https://docs.traefik.io/v2.1/routing/overview/](https://docs.traefik.io/v2.1/routing/overview/)
- [https://docs.traefik.io/v2.1/routing/entrypoints/](https://docs.traefik.io/v2.1/routing/entrypoints/)
- [https://docs.traefik.io/v2.1/routing/routers/#configuring-http-routers](https://docs.traefik.io/v2.1/routing/routers/#configuring-http-routers)
- [https://docs.traefik.io/v2.1/routing/services/#configuring-http-services](https://docs.traefik.io/v2.1/routing/services/#configuring-http-services)
- [https://docs.traefik.io/v2.1/middlewares/overview/](https://docs.traefik.io/v2.1/middlewares/overview/)
- [https://docs.traefik.io/v2.1/middlewares/addprefix/](https://docs.traefik.io/v2.1/middlewares/addprefix/)

---

<div class="post-metadata">

**Author:** ![medri](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/medri/32/1692_2.png) [@medri](https://community.traefik.io/u/medri)\
**Post date:** [March 19, 2020, 12:49pm UTC](https://community.traefik.io/t/simple-proxy-config/4969/4 "2020-03-19T12:49:25Z")

</div>

Thanks Idez,  
I have the same requirement as the first post.  
Your solution does not work for me but I don't know why.  
My error is "internal server error" through http and "404 page not found" through https

```auto
#Traefik.yaml
providers:
  docker:
    endpoint: "unix:///var/run/docker.sock"
    network: "traefik" # Custom docker network
    exposedByDefault: false # Only expose explicitly enabled containers
  file:
    directory: "/etc/traefik/"
    watch: true

entryPoints:
  unsecure:
    address: ":80"
  secure:
    address: ":443"

api:
  dashboard: true
  insecure: true

log:
  level: DEBUG

```

```auto
# docker-compose.yaml
version: '3.7'

services:

################################################################################

  traefik:
    image: "traefik"
    container_name: "traefik"
    restart: always
    ports:
      - "80:80"
      - "443:443"
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
      - /home/pi/docker/traefik/:/etc/traefik/
    networks:
      - traefik
    labels:
      #Super important!
      - "traefik.enable=true"
      - "traefik.http.routers.traefik.rule=Host(`traefik.dockerpi.local`)"
      - "traefik.http.services.traefik.loadbalancer.server.port=8080"

#############################################################################
[...]

networks:
  traefik:
    external: true

```

And finally my file for the static servers: (I basically copy/pasted your proposal, but stating a plain IP w/o https:// in front gave me a parsing error. I tried //IP and https:// both parsed well, but no resolving)

```auto
# https://docs.traefik.io/v2.1/routing/overview/

http:
  # https://docs.traefik.io/v2.1/routing/routers/#configuring-http-routers
  routers:

    host1:
      rule: Host(`test.dockerpi.local`)
      entryPoints:
        - unsecure
        - secure
      service: host1_svc

  # https://docs.traefik.io/v2.1/routing/services/#configuring-http-services
  services:

    host1_svc:
      loadBalancer:
        servers:
          - url: https://10.1.0.10:91

```
