Redirecting HTTP to HTTPS

You could apply the following plugin for SSL redirect:

apiVersion: configuration.konghq.com/v1
kind: KongPlugin
metadata:
  name: https-redirect
plugin: pre-function
config:
  functions:
  - |
    local forwarded_host = ngx.var.http_x_forwarded_host  or ngx.var.host
    ngx.header["Location"] = "https://" .. forwarded_host .. ngx.var.request_uri
    return kong.response.exit(302)

Please apply this plugin on an Ingress which accepts all paths and all hosts on the http protocol.

If this solves your problem, please mark the post as resolved, thank you!