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

wildcard domain with exclusions #633

Closed
opichon opened this issue Aug 21, 2016 · 1 comment
Closed

wildcard domain with exclusions #633

opichon opened this issue Aug 21, 2016 · 1 comment

Comments

@opichon
Copy link

opichon commented Aug 21, 2016

I need to redirect all wildcard domains to 1 backend, but excluding the subdomains 'www' and 'admin', which must be redirected to another backend.

How do I do this?

using priorities doesn't work.

www:
    labels:
        - "traefik.backend=backend1"
        - "traefik.frontend.rule=Host:www.mydomain.dev"
        - "traefik.frontend.priority=1"

admin:
        labels:
            - "traefik.backend=backend2"
            - "traefik.frontend.rule=Host:admin.mydomain.dev"
            - "traefik.frontend.priority=2"

app:
    labels:
        - "traefik.backend=backend3"
        - "traefik.frontend.rule=HostRegexp:{subdomain:[a-z0-9]+}mydomain.local"
        - "traefik.frontend.priority=10"
@opichon
Copy link
Author

opichon commented Aug 22, 2016

priorities: a higher value means a higher priority.

www:
    labels:
        - "traefik.backend=backend1"
        - "traefik.frontend.rule=Host:www.mydomain.dev"
        - "traefik.frontend.priority=3"

admin:
        labels:
            - "traefik.backend=backend2"
            - "traefik.frontend.rule=Host:admin.mydomain.dev"
            - "traefik.frontend.priority=2"

app:
    labels:
        - "traefik.backend=backend3"
        - "traefik.frontend.rule=HostRegexp:{subdomain:[a-z0-9]+}mydomain.local"
        - "traefik.frontend.priority=1"

@opichon opichon closed this as completed Aug 22, 2016
@traefik traefik locked and limited conversation to collaborators Sep 1, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants