Skip to content

charlie-henaff/traefik

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Traefik proxy

Reverse proxy for development uses

How to use

  • Add traefik network and configuration to services you want to redirect to

    # other project docker-compose.overide.yml
    services:  
      myservice:  
        [...]
         labels:
          - "traefik.enable=true"
          - "traefik.docker.network=[TRAEFIK_NETWORK_NAME]"
          - "traefik.http.routers.[ROUTER].rule=[RULES]"
          - "traefik.http.routers.[ROUTER].entrypoints=[ENTRYPOINTS]"
          - "traefik.http.services.[ROUTER].loadbalancer.server.port=[LOADBALANCER_PORT]"    
        networks:
          - [TRAEFIK_NETWORK_NAME]

    Variables to replace :

    [TRAEFIK_NETWORK_NAME]  : traefik network name (in .env file)
    [ROUTER]                : router custom name for service like 'myservicerouter'
    [RULES]                 : router rules like 'http://myservice.localhost'
    [ENTRYPOINTS]           : router entrypoints like 'secure, insecure'
    [LOADBALANCER_PORT]     : router loadbalancer port like '80' (running port of the targeted service)
    

    Other configuration samples :

    # [RULES] for subdomains like *.myservice.localhost
    HostRegexp(`myservice.localhost`, `{subdomain:[A-Za-z0-9-]+}.myservice.localhost`)
    
  • Start traefix

    docker-compose up -d
  • Live hosts available at http://traefik.localhost/dashboard/#/http/routers

About

Reverse proxy for development uses

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published