Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add multiple entry points support #178

Merged
merged 4 commits into from
Feb 10, 2016

Conversation

emilevauge
Copy link
Member

This PR adds multiple entry points support to traefik, aka, traefik can now listens on http and https :)
This PR also add entry point redirection.

Simple entrypoint definition:

[entryPoints]
  [entryPoints.http]
  address = ":80"

To redirect an http entrypoint to an https entrypoint (with SNI support):

[entryPoints]
  [entryPoints.http]
  address = ":80"
    [entryPoints.http.redirect]
      entryPoint = "https"
  [entryPoints.https]
  address = ":443"
    [entryPoints.https.tls]
      [[entryPoints.https.tls.certificates]]
      CertFile = "integration/fixtures/https/snitest.com.cert"
      KeyFile = "integration/fixtures/https/snitest.com.key"
      [[entryPoints.https.tls.certificates]]
      CertFile = "integration/fixtures/https/snitest.org.cert"
      KeyFile = "integration/fixtures/https/snitest.org.key"

To redirect an entrypoint rewriting the URL:

[entryPoints]
  [entryPoints.http]
  address = ":80"
    [entryPoints.http.redirect]
      regex = "^http://localhost/(.*)"
      replacement = "http://mydomain/$1"

Entrypoints to be used by frontends that do not specify any entrypoint:

defaultEntryPoints = ["http", "https"]

Frontends can overrides defaultEntryPoints:

[frontends]
  [frontends.frontend1]
  backend = "backend2"
    [frontends.frontend1.routes.test_1]
    rule = "Host"
    value = "test.localhost"
  [frontends.frontend2]
  backend = "backend1"
  passHostHeader = true
  entrypoints = ["https"] # overrides defaultEntryPoints
    [frontends.frontend2.routes.test_1]
    rule = "Host"
    value = "{subdomain:[a-z]+}.localhost"
  [frontends.frontend3]
  entrypoints = ["http", "https"] # overrides defaultEntryPoints
  backend = "backend2"
    rule = "Path"
    value = "/test"
  • multiple entry points
  • redirection
  • providers
  • documentation

Fixes #113 and some of #61

@dontrebootme
Copy link

Wow, multiple entrypoints and redirection configuration? This looks great!

@emilevauge
Copy link
Member Author

@rebaseTraefik

@rebaseTraefik
Copy link

I just pushed up the changes, enjoy!

@rebaseTraefik rebaseTraefik force-pushed the add-multiple-entrypoints-support branch from a308320 to b164d04 Compare February 5, 2016 14:59
@vdemeester vdemeester changed the title [WIP] Add multiple entry points support Add multiple entry points support Feb 5, 2016
@vdemeester
Copy link
Contributor

@rebaseTraefik

@rebaseTraefik
Copy link

I just pushed up the changes, enjoy!

@rebaseTraefik rebaseTraefik force-pushed the add-multiple-entrypoints-support branch from b164d04 to 2662097 Compare February 6, 2016 13:07
@@ -9,6 +9,7 @@ import (
"strings"
"time"

"encoding/json"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One line up 👼

@emilevauge emilevauge force-pushed the add-multiple-entrypoints-support branch 3 times, most recently from 6448a0e to 352dab4 Compare February 8, 2016 21:23
@emilevauge
Copy link
Member Author

Fixed and rebased.
If you don't have any better idea regarding the ugly regex, let's merge it then. Will find a better way to manage args later.

@vdemeester
Copy link
Contributor

@rebaseTraefik

@rebaseTraefik
Copy link

I could not rebase add-multiple-entrypoints-support with master. There are conflicts.

@emilevauge emilevauge force-pushed the add-multiple-entrypoints-support branch from 352dab4 to 4152bd5 Compare February 10, 2016 11:19
vdemeester added a commit that referenced this pull request Feb 10, 2016
@rogierlommers
Copy link

Sorry to bump, but I'm having a hard time to create a frontend (only a frontend) which redirects traffic from abc.com to xyz.com. Can someone please point me to some examples?

@traefiker
Copy link
Contributor

Hi! I'm Træfiker 🤖 the bot in charge of communication regulation.

Thanks for your interest in Træfik, but this issue is now closed 🔒

You can join our Slack workspace for more community #support.

If needed, you can also open a new issue (and follow the bug or feature templates).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Listen on both HTTP and HTTPS
7 participants