commit
f99f634816
7 changed files with 41 additions and 21 deletions
|
@ -6,6 +6,7 @@
|
||||||
[![Build Status](https://travis-ci.org/containous/traefik.svg?branch=master)](https://travis-ci.org/containous/traefik)
|
[![Build Status](https://travis-ci.org/containous/traefik.svg?branch=master)](https://travis-ci.org/containous/traefik)
|
||||||
[![Docs](https://img.shields.io/badge/docs-current-brightgreen.svg)](https://docs.traefik.io)
|
[![Docs](https://img.shields.io/badge/docs-current-brightgreen.svg)](https://docs.traefik.io)
|
||||||
[![Go Report Card](https://goreportcard.com/badge/kubernetes/helm)](http://goreportcard.com/report/containous/traefik)
|
[![Go Report Card](https://goreportcard.com/badge/kubernetes/helm)](http://goreportcard.com/report/containous/traefik)
|
||||||
|
[![Image Layer](https://badge.imagelayers.io/traefik:latest.svg)](https://imagelayers.io/?images=traefik)
|
||||||
[![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/containous/traefik/blob/master/LICENSE.md)
|
[![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/containous/traefik/blob/master/LICENSE.md)
|
||||||
[![Join the chat at https://traefik.herokuapp.com](https://img.shields.io/badge/style-register-green.svg?style=social&label=Slack)](https://traefik.herokuapp.com)
|
[![Join the chat at https://traefik.herokuapp.com](https://img.shields.io/badge/style-register-green.svg?style=social&label=Slack)](https://traefik.herokuapp.com)
|
||||||
[![Twitter](https://img.shields.io/twitter/follow/traefikproxy.svg?style=social)](https://twitter.com/intent/follow?screen_name=traefikproxy)
|
[![Twitter](https://img.shields.io/twitter/follow/traefikproxy.svg?style=social)](https://twitter.com/intent/follow?screen_name=traefikproxy)
|
||||||
|
@ -51,7 +52,7 @@ Run it and forget it!
|
||||||
- Circuit breakers on backends
|
- Circuit breakers on backends
|
||||||
- Round Robin, rebalancer load-balancers
|
- Round Robin, rebalancer load-balancers
|
||||||
- Rest Metrics
|
- Rest Metrics
|
||||||
- Tiny docker image included [![Image Layers](https://badge.imagelayers.io/containous/traefik:latest.svg)](https://imagelayers.io/?images=containous/traefik:latest)
|
- [Tiny](https://imagelayers.io/?images=traefik) [official](https://hub.docker.com/r/_/traefik/) docker image included
|
||||||
- SSL backends support
|
- SSL backends support
|
||||||
- SSL frontend support (with SNI)
|
- SSL frontend support (with SNI)
|
||||||
- Clean AngularJS Web UI
|
- Clean AngularJS Web UI
|
||||||
|
@ -92,7 +93,7 @@ You can access to a simple HTML frontend of Træfik.
|
||||||
- Use the tiny Docker image:
|
- Use the tiny Docker image:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
docker run -d -p 8080:8080 -p 80:80 -v $PWD/traefik.toml:/etc/traefik/traefik.toml containous/traefik
|
docker run -d -p 8080:8080 -p 80:80 -v $PWD/traefik.toml:/etc/traefik/traefik.toml traefik
|
||||||
```
|
```
|
||||||
|
|
||||||
- From sources:
|
- From sources:
|
||||||
|
|
|
@ -52,7 +52,7 @@ Transfer/sec: 0.99MB
|
||||||
```sh
|
```sh
|
||||||
$ docker run -d -l traefik.backend=test1 -l traefik.frontend.rule=Host -l traefik.frontend.value=test.traefik.localhost emilevauge/whoami
|
$ docker run -d -l traefik.backend=test1 -l traefik.frontend.rule=Host -l traefik.frontend.value=test.traefik.localhost emilevauge/whoami
|
||||||
$ docker run -d -l traefik.backend=test1 -l traefik.frontend.rule=Host -l traefik.frontend.value=test.traefik.localhost emilevauge/whoami
|
$ docker run -d -l traefik.backend=test1 -l traefik.frontend.rule=Host -l traefik.frontend.value=test.traefik.localhost emilevauge/whoami
|
||||||
$ docker run -d -p 8080:8080 -p 80:80 -v $PWD/traefik.toml:/traefik.toml -v /var/run/docker.sock:/var/run/docker.sock containous/traefik
|
$ docker run -d -p 8080:8080 -p 80:80 -v $PWD/traefik.toml:/traefik.toml -v /var/run/docker.sock:/var/run/docker.sock traefik
|
||||||
$ wrk -t12 -c400 -d60s -H "Host: test.traefik.localhost" --latency http://127.0.0.1:80
|
$ wrk -t12 -c400 -d60s -H "Host: test.traefik.localhost" --latency http://127.0.0.1:80
|
||||||
Running 1m test @ http://127.0.0.1:80
|
Running 1m test @ http://127.0.0.1:80
|
||||||
12 threads and 400 connections
|
12 threads and 400 connections
|
||||||
|
|
|
@ -57,7 +57,7 @@ You can grab the latest binary from the [releases](https://github.com/containous
|
||||||
Using the tiny Docker image:
|
Using the tiny Docker image:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
docker run -d -p 8080:8080 -p 80:80 -v $PWD/traefik.toml:/etc/traefik/traefik.toml containous/traefik
|
docker run -d -p 8080:8080 -p 80:80 -v $PWD/traefik.toml:/etc/traefik/traefik.toml traefik
|
||||||
```
|
```
|
||||||
|
|
||||||
## Test it
|
## Test it
|
||||||
|
@ -66,7 +66,7 @@ You can test Træfɪk easily using [Docker compose](https://docs.docker.com/comp
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
traefik:
|
traefik:
|
||||||
image: containous/traefik
|
image: traefik
|
||||||
command: --web --docker --docker.domain=docker.localhost --logLevel=DEBUG
|
command: --web --docker --docker.domain=docker.localhost --logLevel=DEBUG
|
||||||
ports:
|
ports:
|
||||||
- "80:80"
|
- "80:80"
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
traefik:
|
traefik:
|
||||||
image: containous/traefik
|
image: traefik
|
||||||
command: --web --docker --docker.domain=docker.localhost --logLevel=DEBUG
|
command: --web --docker --docker.domain=docker.localhost --logLevel=DEBUG
|
||||||
ports:
|
ports:
|
||||||
- "80:80"
|
- "80:80"
|
||||||
|
|
11
rules.go
11
rules.go
|
@ -3,6 +3,7 @@ package main
|
||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
"github.com/gorilla/mux"
|
"github.com/gorilla/mux"
|
||||||
|
"net"
|
||||||
"net/http"
|
"net/http"
|
||||||
"reflect"
|
"reflect"
|
||||||
"sort"
|
"sort"
|
||||||
|
@ -12,12 +13,17 @@ import (
|
||||||
// Rules holds rule parsing and configuration
|
// Rules holds rule parsing and configuration
|
||||||
type Rules struct {
|
type Rules struct {
|
||||||
route *serverRoute
|
route *serverRoute
|
||||||
|
err error
|
||||||
}
|
}
|
||||||
|
|
||||||
func (r *Rules) host(hosts ...string) *mux.Route {
|
func (r *Rules) host(hosts ...string) *mux.Route {
|
||||||
return r.route.route.MatcherFunc(func(req *http.Request, route *mux.RouteMatch) bool {
|
return r.route.route.MatcherFunc(func(req *http.Request, route *mux.RouteMatch) bool {
|
||||||
|
reqHost, _, err := net.SplitHostPort(req.Host)
|
||||||
|
if err != nil {
|
||||||
|
reqHost = req.Host
|
||||||
|
}
|
||||||
for _, host := range hosts {
|
for _, host := range hosts {
|
||||||
if strings.EqualFold(req.Host, strings.TrimSpace(host)) {
|
if reqHost == strings.TrimSpace(host) {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -129,6 +135,9 @@ func (r *Rules) Parse(expression string) (*mux.Route, error) {
|
||||||
method := reflect.ValueOf(parsedFunction)
|
method := reflect.ValueOf(parsedFunction)
|
||||||
if method.IsValid() {
|
if method.IsValid() {
|
||||||
resultRoute := method.Call(inputs)[0].Interface().(*mux.Route)
|
resultRoute := method.Call(inputs)[0].Interface().(*mux.Route)
|
||||||
|
if r.err != nil {
|
||||||
|
return nil, r.err
|
||||||
|
}
|
||||||
if resultRoute.GetError() != nil {
|
if resultRoute.GetError() != nil {
|
||||||
return nil, resultRoute.GetError()
|
return nil, resultRoute.GetError()
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,20 +31,22 @@ ghr -t $GITHUB_TOKEN -u containous -r traefik --prerelease ${VERSION} dist/
|
||||||
|
|
||||||
# update docs.traefik.io
|
# update docs.traefik.io
|
||||||
echo "Generating and updating documentation..."
|
echo "Generating and updating documentation..."
|
||||||
# mkdir site
|
# DOESN'T WORK :'(
|
||||||
# cd site
|
# git remote add ssh git@github.com:containous/traefik.git
|
||||||
# git init
|
# mkdocs gh-deploy -m $VERSION -c -r ssh
|
||||||
# git remote add origin git@github.com:containous/traefik.git
|
|
||||||
# git fetch origin
|
mkdir site
|
||||||
# git checkout gh-pages
|
cd site
|
||||||
# cd ..
|
git init
|
||||||
# mkdocs build --clean
|
git remote add origin git@github.com:containous/traefik.git
|
||||||
# cd site
|
git fetch origin
|
||||||
# git add .
|
git checkout gh-pages
|
||||||
# echo $VERSION | git commit --file -
|
cd ..
|
||||||
# git push -q -f origin gh-pages > /dev/null 2>&1
|
mkdocs build --clean
|
||||||
git remote add ssh git@github.com:containous/traefik.git
|
cd site
|
||||||
mkdocs gh-deploy -c -r ssh
|
git add .
|
||||||
|
echo $VERSION | git commit --file -
|
||||||
|
git push -q -f origin gh-pages > /dev/null 2>&1
|
||||||
|
|
||||||
# update traefik-library-image repo (official Docker image)
|
# update traefik-library-image repo (official Docker image)
|
||||||
echo "Updating traefik-library-imag repo..."
|
echo "Updating traefik-library-imag repo..."
|
||||||
|
|
|
@ -24,3 +24,11 @@
|
||||||
.tabset-row__providers {
|
.tabset-row__providers {
|
||||||
margin-top: 3rem;
|
margin-top: 3rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
table {
|
||||||
|
table-layout: fixed;
|
||||||
|
}
|
||||||
|
|
||||||
|
td, th {
|
||||||
|
word-wrap: break-word;
|
||||||
|
}
|
Loading…
Reference in a new issue