Kong Ingress Annotations (Redirect)

Greetings,

I was wondering if kong ingress had an anotation similar to NGINX’s nginx.ingress.kubernetes.io/permanent-redirect

I won’t go too much in detail what i’m trying to do, but this would quickly solve my issue.

Thanks,
Sartigan

You can do this using KongIngress resource.
Create a KongIngress resource with route.https_redirect_status_code set to 301 and then annotate your Ingress resource with configuration.konghq.com: <name of KongIngress resource..

Hi @hbagdi,

I have followed that document. But I am getting redirect loop on https
What am I missing?

sh-4.2$ curl -I http://2048.test.com
HTTP/1.1 302 Moved Temporarily
Date: Tue, 11 Feb 2020 16:07:26 GMT
Content-Type: text/html
Content-Length: 110
Connection: keep-alive
Location: https://2048.test.com
X-Kong-Response-Latency: 0
Server: kong/1.4.3

sh-4.2$ curl -I https://2048.test.com
HTTP/1.1 302 Moved Temporarily
Date: Tue, 11 Feb 2020 16:07:33 GMT
Content-Type: text/html
Content-Length: 110
Connection: keep-alive
Location: https://2048.test.com
X-Kong-Response-Latency: 1
Server: kong/1.4.3

Both HTTP and HTTPS are redirected causing loop.

See my configuration here: HTTP to HTTPS redirect with kong-ingress and TLS-offloading


© 2019 Kong Inc.    Terms  •  Privacy  •  FAQ