# ERR\_TOO\_MANY\_REDIRECTS 302 with ELK Operator 7.10.0

**URL:** <https://discuss.elastic.co/t/err-too-many-redirects-302-with-elk-operator-7-10-0/259504>\
**Category:** Kibana\
**Created:** [December 23, 2020, 3:44pm UTC](https://discuss.elastic.co/t/err-too-many-redirects-302-with-elk-operator-7-10-0/259504 "2020-12-23T15:44:39Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![inforedaster](https://avatars.discourse-cdn.com/v4/letter/i/9fc348/32.png) [@inforedaster](https://discuss.elastic.co/u/inforedaster)\
**Post date:** [December 23, 2020, 3:44pm UTC](https://discuss.elastic.co/t/err-too-many-redirects-302-with-elk-operator-7-10-0/259504/1 "2020-12-23T15:44:39Z")

</div>

hello,

i have an Elastick stack elasticsearch and kibana 7.10.0 using elk operator in kubernetes

Whene i make the link [https://monitoring.cloudapp.azure.com/kibana](https://monitoring.cloudapp.azure.com/kibana) i have this redirection :

> [https://monitoring.cloudapp.azure.com/kibana/login?next=%2Fkibana%2Fkibana%2Flogin%3Fnext%3D%252Fkibana%252Fkibana%252Flogin%253Fnext%253D%25252Fkibana%25252Fkibana%25](https://monitoring.cloudapp.azure.com/kibana/login?next=%2Fkibana%2Fkibana%2Flogin%3Fnext%3D%252Fkibana%252Fkibana%252Flogin%253Fnext%253D%25252Fkibana%25252Fkibana%25)......

in the pod logs :

> "type":"response","@timestamp":"2020-12-23T15:38:27Z","tags":,"pid":7,"method":"get","statusCode":302,"req":{"url":"/kibana/login?next=%2Fkibana%2Fkibana%2Flogin%3Fnext%3D%252Fkibana%252.....

Kibana.yaml

```
apiVersion: kibana.k8s.elastic.co/v1
kind: Kibana
metadata:
  name: kibana
spec:
  version: 7.10.0
  count: 1
  elasticsearchRef:
    name: elastic-https
  http:
    service:
      spec:
        type: ClusterIP
    tls:
      selfSignedCertificate:
        disabled: true
  podTemplate:
    spec:
      containers:
      - name: kibana
        env:
        - name: SERVER_BASEPATH
          value: "/kibana"
        resources:
          requests:
            memory: 4Gi
            cpu: 1
          limits:
            memory: 8Gi
            cpu: 2
    metadata:
      annotations:
        sidecar.istio.io/rewriteAppHTTPProbers: "true"

```

kibana.ingress.yaml

```
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  annotations:
    kubernetes.io/ingress.class: istio
  name: kibana-ingress
spec:
  rules:
    - host: "monitoring.cloudapp.azure.com"
      http:
        paths:
          - path: /kibana/login.*
            backend:
              serviceName: kibana-kb-http
              servicePort: 5601
          - path: /kibana
            backend:
              serviceName: kibana-kb-http
              servicePort: 5601
          - path: /kibana/*
            backend:
              serviceName: kibana-kb-http
              servicePort: 5601

```

Any idea please.  
thanks

---

<div class="post-metadata">

**Author:** ![jbudz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jbudz/32/45922_2.png) [@jbudz](https://discuss.elastic.co/u/jbudz)\
**Post date:** [December 23, 2020, 4:34pm UTC](https://discuss.elastic.co/t/err-too-many-redirects-302-with-elk-operator-7-10-0/259504/2 "2020-12-23T16:34:58Z")

</div>

Can you try opening in an incognito window? We most commonly see this when a session cookie can't be decrypted, caused by logging in across restarts.

If that doesn't work I would target the proxy configuration next. We can probably simplify the rules to one `/kibana/` path and go from there. I'm not too familiar with the proxy configuration here, but generally kibana will want a trailing slash to start the redirect process.

---

<div class="post-metadata">

**Author:** ![inforedaster](https://avatars.discourse-cdn.com/v4/letter/i/9fc348/32.png) [@inforedaster](https://discuss.elastic.co/u/inforedaster)\
**Post date:** [December 23, 2020, 4:42pm UTC](https://discuss.elastic.co/t/err-too-many-redirects-302-with-elk-operator-7-10-0/259504/3 "2020-12-23T16:42:54Z")

</div>

> [@jbudz](#):
>
> If that doesn't work I would target the proxy configuration next. We can probably simplify the rules to one `/kibana/` path and go from there. I'm not too familiar with the proxy configuration here, but generally kibana will want a trailing slash to start the redirect process.

no ay with incognito window i have the same problem whene i do a kubectl port-forward i have the same problem with the redirection (with http)

`http://localhost:52000/kibana/login?next=%2Fkibana%2Fkibana%2Flogin%3Fnext%`

---

<div class="post-metadata">

**Author:** ![jbudz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jbudz/32/45922_2.png) [@jbudz](https://discuss.elastic.co/u/jbudz)\
**Post date:** [December 23, 2020, 6:34pm UTC](https://discuss.elastic.co/t/err-too-many-redirects-302-with-elk-operator-7-10-0/259504/4 "2020-12-23T18:34:04Z")

</div>

Can you try setting `SERVER_REWRITEBASEPATH` to true, [ref](https://www.elastic.co/guide/en/kibana/master/settings.html#server-rewriteBasePath) and removing the proxy rewrite rules?

---

<div class="post-metadata">

**Author:** ![inforedaster](https://avatars.discourse-cdn.com/v4/letter/i/9fc348/32.png) [@inforedaster](https://discuss.elastic.co/u/inforedaster)\
**Post date:** [December 23, 2020, 8:20pm UTC](https://discuss.elastic.co/t/err-too-many-redirects-302-with-elk-operator-7-10-0/259504/5 "2020-12-23T20:20:38Z")

</div>

when i add the SERVER\_REWRITEBASEPATH then i have a readinessProbe problem and the kibana doesn't starts

```
  readinessProbe:
        httpGet:
          path: /login
          port: 5601
          scheme: HTTP
        initialDelaySeconds: 10
        timeoutSeconds: 5
        periodSeconds: 10
        successThreshold: 1
        failureThreshold: 3
```

---

<div class="post-metadata">

**Author:** ![jbudz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jbudz/32/45922_2.png) [@jbudz](https://discuss.elastic.co/u/jbudz)\
**Post date:** [December 23, 2020, 8:23pm UTC](https://discuss.elastic.co/t/err-too-many-redirects-302-with-elk-operator-7-10-0/259504/6 "2020-12-23T20:23:25Z")

</div>

Does that include the base path? I would set it to something like localhost:5601/kibana/api/status

---

<div class="post-metadata">

**Author:** ![inforedaster](https://avatars.discourse-cdn.com/v4/letter/i/9fc348/32.png) [@inforedaster](https://discuss.elastic.co/u/inforedaster)\
**Post date:** [December 24, 2020, 5:11pm UTC](https://discuss.elastic.co/t/err-too-many-redirects-302-with-elk-operator-7-10-0/259504/7 "2020-12-24T17:11:15Z")

</div>

it's ok for me it works well  
i aded

```
apiVersion: kibana.k8s.elastic.co/v1
kind: Kibana
metadata:
  name: kibana
spec:
  config:
    server.rewriteBasePath: true

```

and

```
  containers:
  - name: kibana
    readinessProbe:
      httpGet:
        scheme: HTTP
        path: /kibana
        port: 5601

```

thank you very much @jbudz

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [January 21, 2021, 5:11pm UTC](https://discuss.elastic.co/t/err-too-many-redirects-302-with-elk-operator-7-10-0/259504/8 "2021-01-21T17:11:28Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
