traefik/docs/content/middlewares/redirectscheme.md
2019-09-10 14:40:05 +02:00

1.3 KiB

RedirectScheme

Redirecting the Client to a Different Scheme/Port {: .subtitle }

RegexRedirect redirect request from a scheme to another.

Configuration Examples

# Redirect to https
labels:
- "traefik.http.middlewares.test-redirectscheme.redirectscheme.scheme=https"
# Redirect to https
apiVersion: traefik.containo.us/v1alpha1
kind: Middleware
metadata:
  name: test-redirectscheme
spec:
  redirectScheme:
    scheme: https
"labels": {
  "traefik.http.middlewares.test-redirectscheme.redirectscheme.scheme": "https"
}
# Redirect to https
labels:
- "traefik.http.middlewares.test-redirectscheme.redirectscheme.scheme=https"
# Redirect to https
[http.middlewares]
  [http.middlewares.test-redirectscheme.redirectScheme]
    scheme = "https"
# Redirect to https
http:
  middlewares:
    test-redirectscheme:
      redirectScheme:
        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.