• RedirectScheme
    • Configuration Examples
    • Configuration Options
      • permanent
      • scheme
      • port

    RedirectScheme

    Redirecting the Client to a Different Scheme/Port

    RegexRedirect redirect request from a scheme to another.

    Configuration Examples

    1. # Redirect to https
    2. labels:
    3. - "traefik.http.middlewares.test-redirectscheme.redirectscheme.scheme=https"
    1. # Redirect to https
    2. apiVersion: traefik.containo.us/v1alpha1
    3. kind: Middleware
    4. metadata:
    5. name: test-redirectscheme
    6. spec:
    7. redirectScheme:
    8. scheme: https
    1. "labels": {
    2. "traefik.http.middlewares.test-redirectscheme.redirectscheme.scheme": "https"
    3. }
    1. # Redirect to https
    2. labels:
    3. - "traefik.http.middlewares.test-redirectscheme.redirectscheme.scheme=https"
    1. # Redirect to https
    2. [http.middlewares]
    3. [http.middlewares.test-redirectscheme.redirectScheme]
    4. scheme = "https"
    1. # Redirect to https
    2. http:
    3. middlewares:
    4. test-redirectscheme:
    5. redirectScheme:
    6. scheme: https

    Configuration Options

    permanent

    Set the permanent option to true to apply a permanent redirection.

    scheme

    The scheme option defines the scheme of the new url.

    port

    The port option defines the port of the new url.