# Keycloak 20.0.1 in k8s and behind reverse proxy

**URL:** <https://forum.keycloak.org/t/keycloak-20-0-1-in-k8s-and-behind-reverse-proxy/18728>\
**Category:** Configuring the server\
**Tags:** admin-console\
**Created:** [December 1, 2022, 8:18am UTC](https://forum.keycloak.org/t/keycloak-20-0-1-in-k8s-and-behind-reverse-proxy/18728 "2022-12-01T08:18:05Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![john047](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/john047/32/7143_2.png) [@john047](https://forum.keycloak.org/u/john047)\
**Post date:** [December 1, 2022, 8:18am UTC](https://forum.keycloak.org/t/keycloak-20-0-1-in-k8s-and-behind-reverse-proxy/18728/1 "2022-12-01T08:18:05Z")

</div>

Hello,

Keycloak is running in k8s, behind a reverse proxy.  
Commands with which the application is started:

```auto
command:
  - /opt/keycloak/bin/kc.sh
  - --verbose
  - start
  - --proxy=edge
  - --http-relative-path /tri/auth
  - --hostname-strict=false
  - --hostname-strict-https=false
  - --http-enabled=true

```

ingress rule:

```auto
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: tri-keycloak
  namespace: tri-dev
  annotations:
    kubernetes.io/ingress.class: nginx
    nginx.ingress.kubernetes.io/proxy-buffer-size: 128k
spec:
  rules:
    - host: tri-dev-proxy.example.com
      http:
        paths:
          - path: /tri/auth/
            pathType: Prefix
            backend:
              service:
                name: tri-keycloak-20-http
                port:
                  number: 80

```

config proxy:

```auto
location /tri/ {
    proxy_pass http://kube-node-ingress-upstream-80;
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Host $host;
    proxy_set_header X-Forwarded-Server $host;
    proxy_set_header X-Forwarded-Port $server_port;
    proxy_set_header X-Forwarded-Proto $scheme;
}

```

cat /etc/nginx/upstream.d/kube.upstream.conf

```auto
upstream kube-node-ingress-upstream-80 {
  server tri-dev-kube-node-1.priv:80;
  server tri-dev-kube-node-2.priv:80;
  server tri-dev-kube-node-3.priv:80;
}

```

[https://tri-dev-proxy.example.com/tri/auth/](https://tri-dev-proxy.example.com/tri/auth/) - the start page is available at this URL, but when you go to the admin console, it redirects to http ([http://tri-dev-proxy.example.com/tri/auth/admin/](http://tri-dev-proxy.example.com/tri/auth/admin/)), page not available.  
In the ingress controller logs, the response is 200, when I go to the start page, they are not there when I enter the admin panel:

```auto
10.208.38.11 - - [01/Dec/2022:06:40:41 +0000] "GET /tri/auth/resources/g95ve/welcome/keycloak/logo.png HTTP/1.0" 200 7539 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36" 775 0.016 [tri-dev-tri-keycloak-20-http-80] [] 10.233.104.232:8080 7539 0.016 200 12ed1e9084c4958620495cc04c817f99
10.208.38.11 - - [01/Dec/2022:06:40:41 +0000] "GET /tri/auth/resources/g95ve/welcome/keycloak/img/favicon.ico HTTP/1.0" 200 650 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36" 782 0.006 [tri-dev-tri-keycloak-20-http-80] [] 10.233.104.232:8080 650 0.008 200 315323245937fb56f6b7cb6cfe91f560

```

Please tell me where is the mistake.

---

<div class="post-metadata">

**Author:** ![john047](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/john047/32/7143_2.png) [@john047](https://forum.keycloak.org/u/john047)\
**Post date:** [December 6, 2022, 1:59pm UTC](https://forum.keycloak.org/t/keycloak-20-0-1-in-k8s-and-behind-reverse-proxy/18728/2 "2022-12-06T13:59:55Z")

</div>

How to run keycloak with reverse proxy and without certificate?

---

<div class="post-metadata">

**Author:** ![lsoft-bho](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/lsoft-bho/32/6755_2.png) [@lsoft-bho](https://forum.keycloak.org/u/lsoft-bho)\
**Post date:** [December 7, 2022, 6:25am UTC](https://forum.keycloak.org/t/keycloak-20-0-1-in-k8s-and-behind-reverse-proxy/18728/3 "2022-12-07T06:25:39Z")

</div>

There currently seems to be issues with loading the admin console in a k8s environment:

> <https://github.com/keycloak/keycloak/issues/14666>
>
> \### Describe the bug
> 
> It seems the new admin console doesn't load properly und…er some configurations, and this has been reported many times in different issues.
> 
> This is serving as an umbrella issue to collect all the reported issues.
> 
> When reporting issues please use the \[hostname-debug tool\](https://www.keycloak.org/server/hostname#\_troubleshooting) to help us figure out what's going on:
> 
> 1. Start Keycloak with the \`--hostname-debug=true\` option
> 2. After starting Keycloak open \`KEYCLOAK\_BASE\_URL/realms/master/hostname-debug\`
> 3. Copy/paste the results to comments below, this will allow us to figure out your configuration, reverse proxy settings, and the results. \*\*If URLs are sensitive please replace with example URLs\*\*
> 
> Reported issues:
> 
> \- \[x\] https://github.com/keycloak/keycloak/issues/14662
> \- \[\] https://github.com/keycloak/keycloak/issues/14586
> \- \[x\] https://github.com/keycloak/keycloak/issues/14668
> \- \[x\] https://github.com/keycloak/keycloak/issues/14637
> \- \[\] https://github.com/keycloak/keycloak/issues/14242
> \- \[\] https://github.com/keycloak/keycloak/issues/14135
> \- \[\] https://github.com/keycloak/keycloak/issues/13665
> \- \[x\] https://github.com/keycloak/keycloak/issues/14628
> \- \[x\] https://github.com/keycloak/keycloak/issues/14812
> \- \[x\] https://github.com/keycloak/keycloak/issues/15375
> \- \[x\] https://github.com/keycloak/keycloak/issues/12766
> \- \[x\] https://github.com/keycloak/keycloak/issues/17137
> \- \[x\] https://github.com/keycloak/keycloak/issues/17586
> \- \[x\] https://github.com/keycloak/keycloak/issues/19590
> \- \[\] https://github.com/keycloak/keycloak/issues/12823
> \- \[\] https://github.com/keycloak/keycloak/issues/19951
> \- \[\] https://github.com/keycloak/keycloak/issues/19821
> \- \[x\] https://github.com/keycloak/keycloak/issues/20145
> \- \[\] https://github.com/keycloak/keycloak/issues/20178
> \- \[x\] https://github.com/keycloak/keycloak/issues/20775
> \- \[\] https://github.com/keycloak/keycloak/issues/21581
> \- \[\] https://github.com/keycloak/keycloak/issues/21670
> \- \[\] https://github.com/keycloak/keycloak/issues/21882
> \- \[\] https://github.com/keycloak/keycloak/issues/21784
> \- \[x\] https://github.com/keycloak/keycloak/issues/22088
> \- \[\] https://github.com/keycloak/keycloak/issues/23000
> 
> Follow-up:
> 
> \- \[\] https://github.com/keycloak/keycloak/issues/15018
> \- \[x\] https://github.com/keycloak/keycloak/issues/15287

---

<div class="post-metadata">

**Author:** ![john047](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/john047/32/7143_2.png) [@john047](https://forum.keycloak.org/u/john047)\
**Post date:** [December 7, 2022, 6:28am UTC](https://forum.keycloak.org/t/keycloak-20-0-1-in-k8s-and-behind-reverse-proxy/18728/4 "2022-12-07T06:28:28Z")

</div>

Which version can I used in which there is no such problem?
