config template, backends

This commit is contained in:
emile 2015-09-14 15:38:58 +02:00
parent 9983757ad3
commit e017e4906e
4 changed files with 225 additions and 27 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

After

Width:  |  Height:  |  Size: 24 KiB

View file

@ -1,7 +1,7 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<title>Traefik</title> <title>/ˈTræfɪk/</title>
<!-- Bootstrap --> <!-- Bootstrap -->
<link rel="stylesheet" href="/static/bootstrap/css/bootstrap.min.css"> <link rel="stylesheet" href="/static/bootstrap/css/bootstrap.min.css">
@ -16,23 +16,16 @@
</head> </head>
<body> <body>
<nav class="navbar navbar-default" role="navigation">
<div class="navbar-header">
<a class="navbar-brand" href="/html/">traefik</a>
</div>
<div class="collapse navbar-collapse navbar-ex1-collapse">
<ul class="nav navbar-nav">
<li><a href="/html/">Configuration</a></li>
</ul>
</div>
</nav>
<div class="container"> <div class="container">
<div class="row"> <div class="jumbotron">
<h1>/ˈTræfɪk/</h1>
</div>
<div class="panel-default col-md-6"> <div class="row">
<div class="panel-heading">Backends</div> <div class="col-md-6">
<div class="panel-body"> <!-- <div class="panel-heading">Backends</div>
<div class="panel-body"> -->
{{range $keyBackends, $valueBackends := .Configuration.Backends}} {{range $keyBackends, $valueBackends := .Configuration.Backends}}
<div class="panel panel-primary" id="{{$keyBackends}}"> <div class="panel panel-primary" id="{{$keyBackends}}">
<div class="panel-heading">{{$keyBackends}}</div> <div class="panel-heading">{{$keyBackends}}</div>
@ -52,12 +45,12 @@
</table> </table>
</div> </div>
{{end}} {{end}}
</div> <!-- </div> -->
</div> </div>
<div class="panel-default col-md-6"> <div class="col-md-6">
<div class="panel-heading">Routes</div> <!-- <div class="panel-heading">Routes</div>
<div class="panel-body"> <div class="panel-body"> -->
{{range $keyRoutes, $valueRoutes := .Configuration.Routes}} {{range $keyRoutes, $valueRoutes := .Configuration.Routes}}
<div class="panel panel-primary"> <div class="panel panel-primary">
<div class="panel-heading">{{$keyRoutes}}</div> <div class="panel-heading">{{$keyRoutes}}</div>
@ -83,7 +76,7 @@
</table> </table>
</div> </div>
{{end}} {{end}}
</div> <!-- </div> -->
</div> </div>
</div> </div>

205
traefik.sample.toml Normal file
View file

@ -0,0 +1,205 @@
################################################################
# Global configuration
################################################################
# Reverse proxy port
#
# Optional
# Default: ":80"
#
# port = ":80"
# Timeout in seconds.
# Duration to give active requests a chance to finish during hot-reloads
#
# Optional
# Default: 10
#
# graceTimeOut = 10
# Traefik logs file
#
# Optional
#
# traefikLogsFile = "log/traefik.log"
# Traefik log to standard output
#
# Optional
# Default: true
#
# traefikLogsStdout = true
# Access logs file
#
# Optional
#
# accessLogsFile = "log/access.log"
# Log level
#
# Optional
# Default: "ERROR"
#
# logLevel = "ERROR"
# SSL certificate and key used
#
# Optional
#
# CertFile = "traefik.crt"
# KeyFile = "traefik.key"
################################################################
# Web configuration backend
################################################################
# Enable web configuration backend
#
# Optional
#
# [web]
# Web administration port
#
# Required
#
# address = ":8080"
################################################################
# File configuration backend
################################################################
# Enable file configuration backend
#
# Optional
#
# [file]
# Rules file
# If defined, traefik will load rules from this file,
# otherwise, it will load rules from current file (cf Sample rules below).
#
# Optional
#
# filename = "rules.toml"
# Enable watch file changes
#
# Optional
#
# watch = true
################################################################
# Docker configuration backend
################################################################
# Enable Docker configuration backend
#
# Optional
#
# [docker]
# Docker server endpoint. Can be a tcp or a unix socket endpoint.
#
# Required
#
# endpoint = "unix:///var/run/docker.sock"
# Enable watch docker changes
#
# Optional
#
# watch = true
# Default domain used.
# Can be overridden by setting the "traefik.domain" label on a container.
#
# Required
#
# domain = "docker.localhost"
# Override default configuration template. For advanced users :)
#
# Optional
#
# filename = "docker.tmpl"
################################################################
# Mesos/Marathon configuration backend
################################################################
# Enable Marathon configuration backend
#
# Optional
#
# [marathon]
# Marathon server endpoint.
# You can also specify multiple endpoint for Marathon:
# endpoint := "http://10.241.1.71:8080,10.241.1.72:8080,10.241.1.73:8080"
#
# Required
#
# endpoint = "http://127.0.0.1:8080"
# Network interface used to call Marathon web services
# Optional
# Default: "eth0"
#
# networkInterface = "eth0"
# Enable watch Marathon changes
#
# Optional
#
# watch = true
# Default domain used.
# Can be overridden by setting the "traefik.domain" label on an application.
#
# Required
#
# domain = "marathon.localhost"
# Override default configuration template. For advanced users :)
#
# Optional
#
# filename = "marathon.tmpl"
################################################################
# Sample rules
################################################################
# [backends]
# [backends.backend1]
# [backends.backend1.servers.server1]
# url = "http://172.17.0.2:80"
# weight = 10
# [backends.backend1.servers.server2]
# url = "http://172.17.0.3:80"
# weight = 1
# [backends.backend2]
# [backends.backend2.servers.server1]
# url = "http://172.17.0.4:80"
# weight = 1
# [backends.backend2.servers.server2]
# url = "http://172.17.0.5:80"
# weight = 2
#
# [routes]
# [routes.route1]
# backend = "backend2"
# [routes.route1.rules.test_1]
# category = "Host"
# value = "test.localhost"
# [routes.route2]
# backend = "backend1"
# [routes.route2.rules.test_2]
# category = "Path"
# value = "/test"

View file

@ -7,7 +7,7 @@
# Optional # Optional
# Default: ":80" # Default: ":80"
# #
# port = ":80" port = ":8081"
# Timeout in seconds. # Timeout in seconds.
# Duration to give active requests a chance to finish during hot-reloads # Duration to give active requests a chance to finish during hot-reloads
@ -58,13 +58,13 @@
# #
# Optional # Optional
# #
# [web] [web]
# Web administration port # Web administration port
# #
# Required # Required
# #
# address = ":8080" address = ":8082"
################################################################ ################################################################
@ -100,26 +100,26 @@
# #
# Optional # Optional
# #
# [docker] [docker]
# Docker server endpoint. Can be a tcp or a unix socket endpoint. # Docker server endpoint. Can be a tcp or a unix socket endpoint.
# #
# Required # Required
# #
# endpoint = "unix:///var/run/docker.sock" endpoint = "unix:///var/run/docker.sock"
# Enable watch docker changes # Enable watch docker changes
# #
# Optional # Optional
# #
# watch = true watch = true
# Default domain used. # Default domain used.
# Can be overridden by setting the "traefik.domain" label on a container. # Can be overridden by setting the "traefik.domain" label on a container.
# #
# Required # Required
# #
# domain = "docker.localhost" domain = "docker.localhost"
# Override default configuration template. For advanced users :) # Override default configuration template. For advanced users :)
# #