# Keycloak reverse proxy

**URL:** <https://forum.keycloak.org/t/keycloak-reverse-proxy/938>\
**Category:** Getting advice\
**Created:** [January 14, 2020, 4:20am UTC](https://forum.keycloak.org/t/keycloak-reverse-proxy/938 "2020-01-14T04:20:13Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![iHunt](https://avatars.discourse-cdn.com/v4/letter/i/74df32/32.png) [@iHunt](https://forum.keycloak.org/u/iHunt)\
**Post date:** [January 14, 2020, 4:20am UTC](https://forum.keycloak.org/t/keycloak-reverse-proxy/938/1 "2020-01-14T04:20:13Z")

</div>

Hello!  
Please help solve problem with proxying.  
I am using the following scheme:  
Keycloack (ver 5.0) is running in a container on Kubernetes. Web access via ingress (url: `http://xxx.k8s.com:30000/`)  
External requests are proxied to ingress from url: `https://yyy.com/` (nginx)  
When I get to the authorization page, I see in html tag “form”: \<form id =“kc-form-login” onsubmit=“login.disabled=true; return true;” action="`http://xxx.k8s.com:30000/auth/realms/...`" instead of `"https://yyy.com/auth/realms/..."`  
How to configure that it uses the correct url.

---

<div class="post-metadata">

**Author:** ![jangaraj](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/jangaraj/32/5175_2.png) [@jangaraj](https://forum.keycloak.org/u/jangaraj)\
**Post date:** [January 14, 2020, 6:56am UTC](https://forum.keycloak.org/t/keycloak-reverse-proxy/938/2 "2020-01-14T06:56:19Z")

</div>

I guess you are using official _jboss/keycloak:latest_ image:

Configure the environment variable **PROXY\_ADDRESS\_FORWARDING=true** for Keycloak containers. Doc [https://hub.docker.com/r/jboss/keycloak](https://hub.docker.com/r/jboss/keycloak) :

> When running Keycloak behind a proxy, you will need to enable proxy address forwarding.
> 
> docker run -e PROXY\_ADDRESS\_FORWARDING=true jboss/keycloak

---

<div class="post-metadata">

**Author:** ![iHunt](https://avatars.discourse-cdn.com/v4/letter/i/74df32/32.png) [@iHunt](https://forum.keycloak.org/u/iHunt)\
**Post date:** [January 14, 2020, 7:02am UTC](https://forum.keycloak.org/t/keycloak-reverse-proxy/938/3 "2020-01-14T07:02:29Z")

</div>

jangaraj, thanks for the answer.  
I tried set env **PROXY\_ADDRESS\_FORWARDING=true** , and CLI `/opt/jboss/keycloak/bin/jboss-cli.sh --connect \ "/subsystem=undertow/server=default-server/http-listener=default:write-attribute(name=proxy-address-forwarding, value=true)"`  
but this did not help.
