HTTPS Redirect

To help users or old services find your https endpoints, it is a common practice to redirect http traffic to https endpoints. With Gloo Gateway, this is a simple matter of creating an auxiliary http virtual service that routes to your full https virtual service

Here is an example redirect config (which is used to host these docs). Please take note of a few details which enable this behavior:

# auxiliary virtual service to redirect http traffic to the full https virtual service
apiVersion: gateway.solo.io/v1
kind: VirtualService
metadata:
  name: docsmgmt-http
  namespace: docs
spec:
  virtualHost:
    domains:
    - docs.solo.io
    routes:
    - matchers:
      - prefix: /
      redirectAction:
        hostRedirect: docs.solo.io
        httpsRedirect: true
---
# main virtual service
apiVersion: gateway.solo.io/v1
kind: VirtualService
metadata:
  name: docsmgmt
  namespace: docs
spec:
  sslConfig:
    secretRef:
      name: docs.solo.io
      namespace: gloo-system
    sniDomains:
    - docs.solo.io
  virtualHost:
    domains:
    - 'docs.solo.io'
    routes:
    - matchers:
# (put the https routes here)