Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Keycloak path settings

I am trying to run Keycloak 3.2.1.Final behind a nginx reverse Proxy (later this will become Ingress). The goal is to reach the same keycloak service from different adresses like so:

  • a.com/foo1/baz1/keycloak/(auth/realms/...)
  • a.com/foo2/baz2/keycloak/(auth/realms/...)
  • ...

and so on.

What I managed to do was change the standalone.xml <web-context> setting from 'auth' to 'foo1/baz1/keycloak' and reach the service like this:

  • localhost:8081/foo1/bar1/keycloak/

but in no combination of configs was I able to make the Nginx Proxy and the Keycloak server work together to be reached via the a.com domain on Port 80.

There is a solution to a very similar question @ Configure reverse-proxy for Keycloak docker with custom base URL

but this does not seem to work (anymore?).

Ty for your time.

like image 246
HolyMarcell Avatar asked Jul 30 '26 02:07

HolyMarcell


1 Answers

In Keycloak 18.x you can set http-relative-path argument, which contains the path relative to '/'.

CLI: --http-relative-path

Env: KC_HTTP_RELATIVE_PATH

like image 159
Dennis Meissel Avatar answered Aug 01 '26 08:08

Dennis Meissel