# Keycloak admin console in docker behind reverse proxy

**URL:** <https://forum.keycloak.org/t/keycloak-admin-console-in-docker-behind-reverse-proxy/17216>\
**Category:** Configuring the server\
**Tags:** admin-console\
**Created:** [September 3, 2022, 7:34am UTC](https://forum.keycloak.org/t/keycloak-admin-console-in-docker-behind-reverse-proxy/17216 "2022-09-03T07:34:22Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![flore](https://avatars.discourse-cdn.com/v4/letter/f/3d9bf3/32.png) [@flore](https://forum.keycloak.org/u/flore)\
**Post date:** [September 3, 2022, 7:34am UTC](https://forum.keycloak.org/t/keycloak-admin-console-in-docker-behind-reverse-proxy/17216/1 "2022-09-03T07:34:22Z")

</div>

Hello,

I am trying to use Keycloak 19.0.1 on a docker container, with nginx 1.18.0 as a reverse proxy

Keycloak is started with:

```auto
docker run -p 127.0.0.1:8080:8080 -e KEYCLOAK_ADMIN=admin -e KEYCLOAK_ADMIN_PASSWORD=admin quay.io/keycloak/keycloak:19.0.1 start-dev --proxy=edge

```

and the nginx configuration is as follows:

```auto
upstream keycloak_app {
    server 127.0.0.1:8080;  
}

server{
server_name kc.hidden.com;
location / {
          proxy_http_version 1.1;
          proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
          proxy_set_header Host $http_host;
          proxy_set_header X-Real-IP $remote_addr;
          proxy_set_header X-Forward-Proto https;
          proxy_set_header X-Forwarded-Host $http_host;
          proxy_set_header X-Forwarded-Server $http_host;
          proxy_set_header X-Request-Id $request_id;
          proxy_pass http://keycloak_app;
    }

}

```

When accessing [https://kc.hidden.com/admin/master/console/](https://kc.hidden.com/admin/master/console/), the page starts loading but the message “Loading the admin console” stays indefinitely and in the browser (Firefox) console, one can read:

```auto
Uncaught (in promise) 
Object { error: "Timeout when waiting for 3rd party check iframe message." }

```

Note that if I access it directly, without going through the reverse proxy (through 127.0.0.1:8080), everything works (I can login).

I tried the (undocumented) option PROXY\_ADDRESS\_FORWARDING: “true” but it still does not work…

---

<div class="post-metadata">

**Author:** ![bruceesmith](https://avatars.discourse-cdn.com/v4/letter/b/e99b99/32.png) [@bruceesmith](https://forum.keycloak.org/u/bruceesmith)\
**Post date:** [September 8, 2022, 11:27am UTC](https://forum.keycloak.org/t/keycloak-admin-console-in-docker-behind-reverse-proxy/17216/2 "2022-09-08T11:27:12Z")

</div>

I too have this problem. Keycloak 17.0.0 in a Docker container behind Nginx (also in a Docker container) worked fine, but since then every release has caused me problems with the admin console (see [http://forum.keycloak.org/t/keycloak-17-admin-console-shows-only-the-top-navigation-bar/14695](http://forum.keycloak.org/t/keycloak-17-admin-console-shows-only-the-top-navigation-bar/14695)

I think the change in behaviour is down to this commit [https://github.com/keycloak/keycloak/commit/3da5a8ea7349ee306895f0071b883901102fe2fd](https://github.com/keycloak/keycloak/commit/3da5a8ea7349ee306895f0071b883901102fe2fd)

So I suspect the problem in my case is down to me not finding a working combination of Nginx and Keycloak configuration settings.

BTW every other Keycloak function in my environment works just fine on 17.0.0 and all versions through to and including 19.0.1 — only the Admin console does not load as expected.

---

<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, 2:55pm UTC](https://forum.keycloak.org/t/keycloak-admin-console-in-docker-behind-reverse-proxy/17216/3 "2022-12-06T14:55:20Z")

</div>

Hi,

Keycloak 20.0.1  
I have also

```auto
Uncaught (in promise) 
Object { error: "Timeout when waiting for 3rd party check iframe message." }

```

how to fix infinite loop of admin console?

---

<div class="post-metadata">

**Author:** ![markculley](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/markculley/32/7311_2.png) [@markculley](https://forum.keycloak.org/u/markculley)\
**Post date:** [December 23, 2022, 5:34pm UTC](https://forum.keycloak.org/t/keycloak-admin-console-in-docker-behind-reverse-proxy/17216/4 "2022-12-23T17:34:43Z")

</div>

I have the same.

1. Use the Dockerfile here: [Running Keycloak in a container - Keycloak](https://www.keycloak.org/server/containers)
2. docker pull and run postgres
3. docker build and run keycloak  
ENV KC\_DB\_URL=jdbc:postgresql://host.docker.internal:5432/postgres
4. in Firefox, visit https:0.0.0.0:8443  
“Welcome to Keycloak” web page showes nicely
5. click on ‘administration console’

`Uncaught (in promise) Object { error: "Timeout when waiting for 3rd party check iframe message." }`

In Chrome F12 also gives me:  
`Failed to load resource: the server responded with a status of 403 ()`, and …

`Indicate whether a cookie is intended to be set in a cross-site context by specifying its SameSite attribute` and `Indicate whether to send a cookie in a cross-site request by specifying its SameSite attribute`

---

<div class="post-metadata">

**Author:** ![voancea](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/voancea/32/7740_2.png) [@voancea](https://forum.keycloak.org/u/voancea)\
**Post date:** [February 21, 2023, 2:30pm UTC](https://forum.keycloak.org/t/keycloak-admin-console-in-docker-behind-reverse-proxy/17216/5 "2023-02-21T14:30:05Z")

</div>

Setting this environment variables helped me:

KC\_HOSTNAME=localhost  
KC\_HOSTNAME\_PORT=8888

Change it accordingly your setup.
