# Configuration Environment Variables KC\_\* are not working

**URL:** <https://forum.keycloak.org/t/configuration-environment-variables-kc-are-not-working/17248>\
**Category:** Miscellanaeous\
**Created:** [September 6, 2022, 9:56am UTC](https://forum.keycloak.org/t/configuration-environment-variables-kc-are-not-working/17248 "2022-09-06T09:56:34Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![zak](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/zak/32/315_2.png) [@zak](https://forum.keycloak.org/u/zak)\
**Post date:** [September 6, 2022, 9:56am UTC](https://forum.keycloak.org/t/configuration-environment-variables-kc-are-not-working/17248/1 "2022-09-06T09:56:34Z")

</div>

Hello everyone,

Environment variables that start with KC\_ as specified in the official documentation are not working out of the box. Not sure if there is something to be done in order for them to get captured by Keycloak, but I see this as counter intuitive.

Here is roughly my docker compose keycloak definition:

```auto
    image: quay.io/keycloak/keycloak:19.0.1
    environment:
      KEYCLOAK_ADMIN: admin
      KEYCLOAK_ADMIN_PASSWORD: admin
      KC_HTTP_ENABLED: "true"
      KC_HOSTNAME: auth-server
      KC_HOSTNAME_PATH: /auth
    ports:
    - "8080:8080"
    entrypoint: ["start"]

```

Keycloak is serving at `/` and not `/auth` which means that `KC_HOSTNAME_PATH` is ignored

I know this question have been asked at least two times here:

- [KeyCloak 19.0.1: KC\_\* Environment variables are ignored - #2 by xgp](http://forum.keycloak.org/t/keycloak-19-0-1-kc-environment-variables-are-ignored/17157/2)
- [Keycloak.X database configuration with Environment variables not work - #2 by zak](http://forum.keycloak.org/t/keycloak-x-database-configuration-with-environment-variables-not-work/7662/2)

but I did not find any clear answer to the question yet.

---

<div class="post-metadata">

**Author:** ![xgp](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/xgp/32/2589_2.png) [@xgp](https://forum.keycloak.org/u/xgp)\
**Post date:** [September 6, 2022, 11:57am UTC](https://forum.keycloak.org/t/configuration-environment-variables-kc-are-not-working/17248/2 "2022-09-06T11:57:17Z")

</div>

I think you’re looking for the `KC_HTTP_RELATIVE_PATH` variable. From the docs:

> Set the path relative to ‘/’ for serving resources.

---

<div class="post-metadata">

**Author:** ![zak](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/zak/32/315_2.png) [@zak](https://forum.keycloak.org/u/zak)\
**Post date:** [September 6, 2022, 12:11pm UTC](https://forum.keycloak.org/t/configuration-environment-variables-kc-are-not-working/17248/3 "2022-09-06T12:11:26Z")

</div>

Thanks this was the issue indeed.
