# Keycloak quarkus: frontendUrl changing not working

**URL:** <https://forum.keycloak.org/t/keycloak-quarkus-frontendurl-changing-not-working/14006>\
**Category:** Miscellanaeous\
**Created:** [March 3, 2022, 4:13pm UTC](https://forum.keycloak.org/t/keycloak-quarkus-frontendurl-changing-not-working/14006 "2022-03-03T16:13:42Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![rvanderboom](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/rvanderboom/32/1463_2.png) [@rvanderboom](https://forum.keycloak.org/u/rvanderboom)\
**Post date:** [March 3, 2022, 4:13pm UTC](https://forum.keycloak.org/t/keycloak-quarkus-frontendurl-changing-not-working/14006/1 "2022-03-03T16:13:42Z")

</div>

i have keycloak quarkus running in kubernetes on port http: (nginx in front of with https)…

However all admin templates (like login form) service “[http://xxx](http://xxx)”  
I tried everything to make it https but it doesn’t pick up:  
-KEYCLOAK\_FRONTEND\_URL / KEYCLOAK\_ADMIN\_URL  
-keycloak.frontendUrl with java -D option.  
It keeps logging:  
g.keycloak.quarkus.runtime.hostname.DefaultHostnameProvider] (main) Hostname settings: FrontEnd: , Strict HTTPS: false, Path: , Strict BackChannel: false, Admin:

No matter what i do…

Don’t understand how to change this.

---

<div class="post-metadata">

**Author:** ![ssunjic24](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/ssunjic24/32/5228_2.png) [@ssunjic24](https://forum.keycloak.org/u/ssunjic24)\
**Post date:** [March 4, 2022, 5:33am UTC](https://forum.keycloak.org/t/keycloak-quarkus-frontendurl-changing-not-working/14006/2 "2022-03-04T05:33:33Z")

</div>

Maybe this will help you I had some issues not like you have but with nginx:  
Modify in standalone.xml

```auto
<http-listener name="default" socket-binding="http" redirect-socket="https" **proxy-address-forwarding="true"** enable-http2="true"/>
<https-listener name="https" socket-binding="https" **proxy-address-forwarding="true"** security-realm="ApplicationRealm" enable-http2="true"/>    

```

---

<div class="post-metadata">

**Author:** ![rvanderboom](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/rvanderboom/32/1463_2.png) [@rvanderboom](https://forum.keycloak.org/u/rvanderboom)\
**Post date:** [March 4, 2022, 7:01am UTC](https://forum.keycloak.org/t/keycloak-quarkus-frontendurl-changing-not-working/14006/3 "2022-03-04T07:01:39Z")

</div>

> [@ssunjic24](#):
>
> e this will help you I had some issues not like you have but with nginx:  
> Modify in standalone.xml

Hey,

oo but then i should have asked other question:  
In keycloak quarkus, we do not see a standalone or any .xml file in config directory anymore…  
Is there another way to put these configuration options , since the only we found out are:

kc.sh --hostname-strict=false --http-enabled=true --hostname-strict-https=false

(ps: if testing everhing on http everyting works fine)

---

<div class="post-metadata">

**Author:** ![bpedersen2](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/bpedersen2/32/3934_2.png) [@bpedersen2](https://forum.keycloak.org/u/bpedersen2)\
**Post date:** [March 4, 2022, 7:26am UTC](https://forum.keycloak.org/t/keycloak-quarkus-frontendurl-changing-not-working/14006/4 "2022-03-04T07:26:09Z")

</div>

There is a setting for proxy in keycloak-x:

> <https://github.com/keycloak/keycloak-community/blob/main/design/keycloak.x/configuration.md#proxy-mode>

You want to set it to `edge`

---

<div class="post-metadata">

**Author:** ![rvanderboom](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/rvanderboom/32/1463_2.png) [@rvanderboom](https://forum.keycloak.org/u/rvanderboom)\
**Post date:** [March 4, 2022, 1:10pm UTC](https://forum.keycloak.org/t/keycloak-quarkus-frontendurl-changing-not-working/14006/5 "2022-03-04T13:10:07Z")

</div>

thanks, this helps,  
Now already that far that with 1 pod admin login is working.  
only with 2 pods i get endless redirects because of a login\_error, well at least one step futher, thanks…

Locally with 2 pods its ok, so must have something todo with settings…

---

<div class="post-metadata">

**Author:** ![rvanderboom](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/rvanderboom/32/1463_2.png) [@rvanderboom](https://forum.keycloak.org/u/rvanderboom)\
**Post date:** [March 4, 2022, 3:21pm UTC](https://forum.keycloak.org/t/keycloak-quarkus-frontendurl-changing-not-working/14006/6 "2022-03-04T15:21:34Z")

</div>

Update about to many redirects, it looks like this issue:

[http://localhost:8091/q/metrics/application](http://localhost:8091/q/metrics/application)

> <https://github.com/codecentric/helm-charts/issues/12>
>
> Hello,
> 
> I am trying to deploy keycloak using Mysql, the charts works just fine… when replica is set to 1, but it doesn't work when it's greater than 1 (eg: 2 or 3). Actually I can see the main athentication page, but once I clic on "Log In" I get \*\*ERR\_TOO\_MANY\_REDIRECTS\*\* error.
> 
> On logs I am getting on every pod :
> \`\`\`
> 09:41:53,225 WARN \[org.keycloak.events\] (default task-1) type=LOGIN\_ERROR, realmId=master, clientId=null, userId=null, ipAddress=10.38.0.0, error=expired\_code, restart\_after\_timeout=true
> 09:41:53,351 WARN \[org.keycloak.events\] (default task-1) type=LOGIN\_ERROR, realmId=master, clientId=null, userId=null, ipAddress=10.38.0.0, error=expired\_code, restart\_after\_timeout=true
> 09:41:53,480 WARN \[org.keycloak.events\] (default task-1) type=LOGIN\_ERROR, realmId=master, clientId=null, userId=null, ipAddress=10.38.0.0, error=expired\_code, restart\_after\_timeout=true
> 09:42:45,412 WARN \[org.keycloak.events\] (default task-4) type=LOGIN\_ERROR, realmId=master, clientId=null, userId=null, ipAddress=10.32.0.1, error=expired\_code, restart\_after\_timeout=true
> 09:42:45,672 WARN \[org.keycloak.events\] (default task-4) type=LOGIN\_ERROR, realmId=master, clientId=null, userId=null, ipAddress=10.32.0.1, error=expired\_code, restart\_after\_timeout=true
> 09:42:45,789 WARN \[org.keycloak.events\] (default task-4) type=LOGIN\_ERROR, realmId=master, clientId=null, userId=null, ipAddress=10.32.0.1, error=expired\_code, restart\_after\_timeout=true
> 09:42:45,907 WARN \[org.keycloak.events\] (default task-4) type=LOGIN\_ERROR, realmId=master, clientId=null, userId=null, ipAddress=10.32.0.1, error=expired\_code, restart\_after\_timeout=true
> 09:42:46,215 WARN \[org.keycloak.events\] (default task-4) type=LOGIN\_ERROR, realmId=master, clientId=null, userId=null, ipAddress=10.32.0.1, error=expired\_code, restart\_after\_timeout=true
> 09:42:46,336 WARN \[org.keycloak.events\] (default task-4) type=LOGIN\_ERROR, realmId=master, clientId=null, userId=null, ipAddress=10.32.0.1, error=expired\_code, restart\_after\_timeout=true
> 09:46:57,976 WARN \[org.keycloak.events\] (default task-5) type=LOGIN\_ERROR, realmId=master, clientId=null, userId=null, ipAddress=10.32.0.1, error=expired\_code, restart\_after\_timeout=true
> 09:46:58,137 WARN \[org.keycloak.events\] (default task-5) type=LOGIN\_ERROR, realmId=master, clientId=null, userId=null, ipAddress=10.32.0.1, error=expired\_code, restart\_after\_timeout=true
> 09:46:58,256 WARN \[org.keycloak.events\] (default task-5) type=LOGIN\_ERROR, realmId=master, clientId=null, userId=null, ipAddress=10.32.0.1, error=expired\_code, restart\_after\_timeout=true
> 09:46:58,375 WARN \[org.keycloak.events\] (default task-5) type=LOGIN\_ERROR, realmId=master, clientId=null, userId=null, ipAddress=10.32.0.1, error=expired\_code, restart\_after\_timeout=true
> 09:46:58,499 WARN \[org.keycloak.events\] (default task-5) type=LOGIN\_ERROR, realmId=master, clientId=null, userId=null, ipAddress=10.32.0.1, error=expired\_code, restart\_after\_timeout=true
> 09:46:58,931 WARN \[org.keycloak.events\] (default task-5) type=LOGIN\_ERROR, realmId=master, clientId=null, userId=null, ipAddress=10.32.0.1, error=expired\_code, restart\_after\_timeout=true
> 09:46:59,108 WARN \[org.keycloak.events\] (default task-5) type=LOGIN\_ERROR, realmId=master, clientId=null, userId=null, ipAddress=10.32.0.1, error=expired\_code, restart\_after\_timeout=true
> \`\`\`
> 
> I tried to add 
> \`\`\` 
> extraEnv: |
> - name: PROXY\_ADDRESS\_FORWARDING
> value: "true" 
> \`\`\`
> 
> But I am still having the same issue.
> 
> Is there any ideas to resolve this?
> 
> Thank you !

however i did set the env:  
env:  
- name: PROXY\_ADDRESS\_FORWARDING  
value: “true”

and it shows up also on the pod when getting env list.

Is there another way in keycloka quarkus setting this ?  
Also tried to debug, and it looks like with 2 pods, there first is successfull login, but then somewhere it doesn’t find the usersession anymore in infinispan…

So i wonder if there need to be specfic settings for this too…  
There really is not a manual, how to migrate from old to new, like check, these settings, configure cache, do this… It looks like just trial-and-error method :-\<

---

<div class="post-metadata">

**Author:** ![rvanderboom](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/rvanderboom/32/1463_2.png) [@rvanderboom](https://forum.keycloak.org/u/rvanderboom)\
**Post date:** [March 4, 2022, 7:40pm UTC](https://forum.keycloak.org/t/keycloak-quarkus-frontendurl-changing-not-working/14006/7 "2022-03-04T19:40:09Z")

</div>

update, yes to many redirects was caused by not setting infinispan to “kubernetes” with KC\_CACHE\_STACK.

without this session are not distributed across the nodes , ending up in login\_error and expired\_session.

the PROXY\_ADDRESS\_FORWARDING doesn’t seem to do anything false or true is the same, removed this setting
