# Kong Ingress Annotations (Redirect)

**URL:** <https://discuss.konghq.com/t/kong-ingress-annotations-redirect/5491>\
**Category:** Questions\
**Tags:** kubernetes\
**Created:** [February 7, 2020, 2:54pm UTC](https://discuss.konghq.com/t/kong-ingress-annotations-redirect/5491 "2020-02-07T14:54:41Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sartigan](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.konghq.com/sartigan/32/1133_2.png) [@Sartigan](https://discuss.konghq.com/u/Sartigan)\
**Post date:** [February 7, 2020, 2:54pm UTC](https://discuss.konghq.com/t/kong-ingress-annotations-redirect/5491/1 "2020-02-07T14:54:41Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![hbagdi](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.konghq.com/hbagdi/32/562_2.png) [@hbagdi](https://discuss.konghq.com/u/hbagdi)\
**Post date:** [February 7, 2020, 6:33pm UTC](https://discuss.konghq.com/t/kong-ingress-annotations-redirect/5491/2 "2020-02-07T18:33:17Z")

</div>

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.`.

---

<div class="post-metadata">

**Author:** ![hbagdi](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.konghq.com/hbagdi/32/562_2.png) [@hbagdi](https://discuss.konghq.com/u/hbagdi)\
**Post date:** [February 7, 2020, 6:54pm UTC](https://discuss.konghq.com/t/kong-ingress-annotations-redirect/5491/3 "2020-02-07T18:54:56Z")

</div>

> <https://github.com/Kong/kubernetes-ingress-controller/blob/master/docs/guides/configuring-https-redirect.md>

---

<div class="post-metadata">

**Author:** ![mnombrado](https://avatars.discourse-cdn.com/v4/letter/m/dec6dc/32.png) [@mnombrado](https://discuss.konghq.com/u/mnombrado)\
**Post date:** [February 11, 2020, 4:30pm UTC](https://discuss.konghq.com/t/kong-ingress-annotations-redirect/5491/4 "2020-02-11T16:30:07Z")

</div>

Hi @hbagdi,

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

```auto
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](https://discuss.konghq.com/t/http-to-https-redirect-with-kong-ingress-and-tls-offloading/4783)

---

<div class="post-metadata">

**Author:** ![seboudry](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.konghq.com/seboudry/32/3351_2.png) [@seboudry](https://discuss.konghq.com/u/seboudry)\
**Post date:** [March 17, 2022, 11:28am UTC](https://discuss.konghq.com/t/kong-ingress-annotations-redirect/5491/5 "2022-03-17T11:28:26Z")

</div>

Hi!

The first question was about a Kong alternative to NGINX’s annotation `nginx.ingress.kubernetes.io/permanent-redirect`.

> This annotation allows to return a permanent redirect (Return Code 301) instead of sending data to the upstream. For example `nginx.ingress.kubernetes.io/permanent-redirect: https://www.google.com` would redirect everything to Google.  
> [https://github.com/kubernetes/ingress-nginx/blob/main/docs/user-guide/nginx-configuration/annotations.md#permanent-redirect](https://github.com/kubernetes/ingress-nginx/blob/main/docs/user-guide/nginx-configuration/annotations.md#permanent-redirect)

For my understanding, answer provided is for redirecting on same host with HTTPS.

Is there a way in Kong Ingress to redirect to another URL?

---

<div class="post-metadata">

**Author:** ![Aleg](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.konghq.com/aleg/32/1826_2.png) [@Aleg](https://discuss.konghq.com/u/Aleg)\
**Post date:** [May 22, 2022, 7:54am UTC](https://discuss.konghq.com/t/kong-ingress-annotations-redirect/5491/6 "2022-05-22T07:54:27Z")

</div>

joining @seboudry - is there such option or do we need to write custom plugins?
