Træfɪk is a modern HTTP reverse proxy and load balancer made to deploy microservices with ease.
@@ -28,12 +28,12 @@ It supports several backends ([Docker :whale:](https://www.docker.com/), [Mesos/
Basically, Træfɪk is a http router, which sends traffic from frontends to http backends, following rules you have configured.
### <a id="frontends"></a> Frontends
### Frontends
Frontends can be defined using the following rules:
-`Headers`: Headers adds a matcher for request header values. It accepts a sequence of key/value pairs to be matched. For example: `application/json`
-`HeadersRegexp`: Regular expressions can be used with headers as well. It accepts a sequence of key/value pairs, where the value has regex support. For example: `application/(text|json)`
-`Headers`: Headers adds a matcher for request header values. It accepts a sequence of key/value pairs to be matched. For example: `Content-Type, application/json`
-`HeadersRegexp`: Regular expressions can be used with headers as well. It accepts a sequence of key/value pairs, where the value has regex support. For example: `Content-Type, application/(text|json)`
-`Host`: Host adds a matcher for the URL host. It accepts a template with zero or more URL variables enclosed by `{}`. Variables can define an optional regexp pattern to be matched: `www.traefik.io`, `{subdomain:[a-z]+}.traefik.io`
-`Methods`: Methods adds a matcher for HTTP methods. It accepts a sequence of one or more methods to be matched, e.g.: `GET`, `POST`, `PUT`
-`Path`: Path adds a matcher for the URL path. It accepts a template with zero or more URL variables enclosed by `{}`. The template must start with a `/`. For exemple `/products/``/articles/{category}/{id:[0-9]+}`
@@ -70,7 +70,7 @@ For example:
-`ResponseCodeRatio(500, 600, 0, 600) > 0.5`: ratio of response codes in range [500-600) to [0-600)
## <a id="launch"></a> Launch configuration
## Launch configuration
Træfɪk can be configured using a TOML file configuration, arguments, or both.
By default, Træfɪk will try to find a `traefik.toml` in the following places:
@@ -176,7 +176,7 @@ Flags:
Use "traefik [command] --help"for more information about a command.
-`/api/providers/{provider}/frontends/{frontend}/routes/{route}`: `GET` a route in a frontend
## <a id="docker"></a> Docker backend
## Docker backend
Træfɪk can be configured to use Docker as a backend configuration:
@@ -793,13 +782,12 @@ Labels can be used on containers to override default behaviour:
-`traefik.weight=10`: assign this weight to the container
-`traefik.enable=false`: disable this container in Træfɪk
-`traefik.frontend.rule=Host:test.traefik.io`: override the default frontend rule (Default: `Host:{containerName}.{domain}`). See [frontends](#frontends).
-`traefik.frontend.value=test.example.com`: override the default frontend value (Default: `{containerName}.{domain}`) See [frontends](#frontends). Must be associated with label traefik.frontend.rule.
-`traefik.frontend.passHostHeader=true`: forward client `Host` header to the backend.
-`traefik.frontend.entryPoints=http,https`: assign this frontend to entry points `http` and `https`. Overrides `defaultEntryPoints`.
*`traefik.domain=traefik.localhost`: override the default domain
## <a id="marathon"></a> Marathon backend
## Marathon backend
Træfɪk can be configured to use Marathon as a backend configuration:
@@ -873,13 +861,12 @@ Labels can be used on containers to override default behaviour:
-`traefik.protocol=https`: override the default `http` protocol
-`traefik.weight=10`: assign this weight to the application
-`traefik.enable=false`: disable this application in Træfɪk
-`traefik.frontend.rule=Host`: override the default frontend rule (Default: Host). See [frontends](#frontends).
-`traefik.frontend.value=test.example.com`: override the default frontend value (Default: `{appName}.{domain}`) See [frontends](#frontends). Must be associated with label traefik.frontend.rule.
-`traefik.frontend.rule=Host:test.traefik.io`: override the default frontend rule (Default: `Host:{containerName}.{domain}`). See [frontends](#frontends).
-`traefik.frontend.passHostHeader=true`: forward client `Host` header to the backend.
-`traefik.frontend.entryPoints=http,https`: assign this frontend to entry points `http` and `https`. Overrides `defaultEntryPoints`.
*`traefik.domain=traefik.localhost`: override the default domain
## <a id="consul"></a> Consul backend
## Consul backend
Træfɪk can be configured to use Consul as a backend configuration:
@@ -929,48 +916,41 @@ prefix = "traefik"
# insecureskipverify = true
```
The Keys-Values structure should look (using `prefix = "/traefik"`):
Please refer to the [KeyValue storage structure](#key-value-storage-structure) section to get documentation en traefik KV structure.
The [Etcd](https://github.com/coreos/etcd/issues/860) and [Consul](https://github.com/hashicorp/consul/issues/886) backends do not support updating multiple keys atomically. As a result, it may be possible for Træfɪk to read an intermediate configuration state despite judicious use of the `--providersThrottleDuration` flag. To solve this problem, Træfɪk supports a special key called `/traefik/alias`. If set, Træfɪk use the value as an alternative key prefix.
@@ -1251,7 +1166,7 @@ Once the `/traefik/alias` key is updated, the new `/traefik_configurations/2` co
Note that Træfɪk *will not watch for key changes in the `/traefik_configurations` prefix*. It will only watch for changes in the `/traefik` prefix. Further, if the `/traefik/alias` key is set, all other sibling keys with the `/traefik` prefix are ignored.
## <a id="benchmarks"></a> Benchmarks
## Benchmarks
Here are some early Benchmarks between Nginx, HA-Proxy and Træfɪk acting as simple load balancers between two servers.
log.Warnf("Label traefik.frontend.value=%s is DEPRECATED, please refer to the rule label: https://github.com/containous/traefik/blob/master/docs/index.md#docker",value)
log.Warnf("Label traefik.frontend.value=%s is DEPRECATED (will be removed in v1.0.0), please refer to the rule label: https://github.com/containous/traefik/blob/master/docs/index.md#docker",value)
// TODO: backwards compatibility with DEPRECATED rule.Value
iflen(route.Value)>0{
route.Rule+=":"+route.Value
log.Warnf("Value %s is DEPRECATED, please refer to the new frontend notation: https://github.com/containous/traefik/blob/master/docs/index.md#-frontends",route.Value)
log.Warnf("Value %s is DEPRECATED (will be removed in v1.0.0), please refer to the new frontend notation: https://github.com/containous/traefik/blob/master/docs/index.md#-frontends",route.Value)
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.