# 502 Bad Gateway Ingress nginx with kibana

**URL:** <https://discuss.elastic.co/t/502-bad-gateway-ingress-nginx-with-kibana/327175>\
**Category:** Kibana\
**Created:** [March 7, 2023, 12:10pm UTC](https://discuss.elastic.co/t/502-bad-gateway-ingress-nginx-with-kibana/327175 "2023-03-07T12:10:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![A\_Mightiev](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/a_mightiev/32/62186_2.png) [@A\_Mightiev](https://discuss.elastic.co/u/A_Mightiev)\
**Post date:** [March 7, 2023, 12:10pm UTC](https://discuss.elastic.co/t/502-bad-gateway-ingress-nginx-with-kibana/327175/1 "2023-03-07T12:10:31Z")

</div>

I deployed kibana on a kubernetes cluster the port-forward locally works, I can surf on kibana but when set my ingress configuration, it comes back with a 502 Bad Gateway. Please help!

This is my ingress configuration:

```auto
kind: Ingress
metadata:
  name: kibana
  namespace: quickstart
  annotations:
    kubernetes.io/ingress.class: nginx
    nginx.ingress.kubernetes.io/force-ssl-redirect: "true"
spec:
  ingressClassName: nginx
  rules:
    - host: kibana.mydomain.com
      http:
        paths:
        - backend:
            service:
              name: quickstart-kb-http 
              port:
                number: 5601
          path: /
          pathType: Prefix
  tls:
  - hosts:
    - kibana.mydomain.com
    secretName: mydomain-secret
status:
  loadBalancer:
    ingress:
    - ip: 10.55.55.55

```

Some logs from ingress:

```auto
2023/03/07 10:19:56 [error] 11977#11977: *278798777 upstream prematurely closed connection while reading response header from upstream, client: 10.41.41.41, server: kibana.mydomain.com, request: "GET /favicon.ico HTTP/2.0", upstream: "http://172.2.2.4:5601/favicon.ico", host: "kibana.mydomain.com", referrer: "https://kibana.mydomain.com/"
2023/03/07 10:19:56 [error] 11977#11977: *278798777 upstream prematurely closed connection while reading response header from upstream, client: 10.41.41.41, server: kibana.mydomain.com, request: "GET /favicon.ico HTTP/2.0", upstream: "http://172.2.2.4:5601/favicon.ico", host: "kibana.mydomain.com", 
  referrer: "https://kibana.mydomain.com/" 10.41.41.41 - - [07/Mar/2023:10:19:56 +0000] "GET /favicon.ico HTTP/2.0" 502 552 "https://kibana.mydomain.com/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko)Chrome/110.0.0.0 Safari/537.36" 146 0.018 [quickstart-quickstart-kb-http-5601] [] 172.2.2.4:5601, 172.2.2.4:5601, 172.2.2.4:5601 0, 0, 0 0.012, 0.004, 0.004 502, 502, 502 81a10e31ca6778cbfd738bae3195dabf

```

Kibana logs do not show anything other than `Kibana is available (was degraded)` info messages.  
this is my service running:

```auto
DESKTOP:~$ kubectl get services quickstart-kb-http
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
quickstart-kb-http ClusterIP 172.2.2.4 <none> 5601/TCP 1d1h

```

my pod:

```auto
DESKTOP:~$ kubectl get pod quickstart-kb-5261adb64f-wtq41
NAME READY STATUS RESTARTS AGE
quickstart-kb-5261adb64f-wtq41 1/1 Running 0 20h

```

As I mentioned, port forward locally works:

```auto
kubectl port-forward quickstart-kb-5261adb64f-wtq41 5601:5601

```

my certificates seem to be working, the browser accepts and deems valid the certificates  
Thank in advance for your assistance

@ [azasypkin](https://discuss.elastic.co/u/azasypkin)?

---

<div class="post-metadata">

**Author:** ![leandrojmp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leandrojmp/32/107231_2.png) [@leandrojmp](https://discuss.elastic.co/u/leandrojmp)\
**Post date:** [March 7, 2023, 12:13pm UTC](https://discuss.elastic.co/t/502-bad-gateway-ingress-nginx-with-kibana/327175/2 "2023-03-07T12:13:56Z")

</div>

You need to share your Kibana logs, from what you shared has nothing related to kibana and it looks like an issue in your network with kubernetes, which is not supported here.

What do you have in Kibana logs?

---

<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:** [April 4, 2023, 12:14pm UTC](https://discuss.elastic.co/t/502-bad-gateway-ingress-nginx-with-kibana/327175/3 "2023-04-04T12:14:13Z")

</div>

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