Admin console is not accessible without appended relative path value

Recently we migrated from v15 to v25. We needed to keep legacy /auth in the path, hence relative path parameter was used. Now every time we access the KC admin console we need to append /auth to the host (i.e. https://my.keycloak.com/auth instead of just https://my.keycloak.com). Whenever we make a request without /auth, the response is Resource not found. What is wrong with my configuration?

keycloak_relative_path = "/auth"
service_environment = [
    {
        "name": "KC_DB_URL_HOST",
        "value": var.database.address
    },
    {
        "name" : "KC_DB_URL_DATABASE",
        "value" : var.database.db_name
    },
    {
        "name" : "KC_DB_SCHEMA",
        "value" : "public"
    },
    {
        "name" : "KC_DB",
        "value" : "postgres"
    },
    {
        "name" : "KEYCLOAK_USER",
        "value" : "admin"
    },
    {
        "name": "KC_HTTP_RELATIVE_PATH",
        "value": local.keycloak_relative_path
    },
    {
        "name": "KC_LOG_LEVEL",
        "value": "INFO"
    },
    {
        "name": "KC_LOG_CONSOLE_OUTPUT",
        "value": "json"
    },
    {
        "name": "KC_LOG",
        "value": "console"
    },
    {
        "name" : "KC_HOSTNAME",
        "value" : format("%s%s", var.keycloak_hostname, local.keycloak_relative_path)
    },
    {
        "name" : "KC_PROXY_HEADERS",
        "value" : "forwarded"
    },
    {
        "name" : "KC_HTTP_ENABLED",
        "value" : "true"
    },
    {
        "name" : "KC_HEALTH_ENABLED",
        "value" : "true"
    }
]

You need to set the admin hostname as well if you don’t want it to share the same endpoint as hostname: KC_HOSTNAME_ADMIN

More details here: Configuring the hostname (v2) - Keycloak

If you set the KC_HTTP_RELATIVE_PATH, you always will have to add this path to your URL if you just enter the root path. Keycloak won’t redirect to the relative path. Thus, showing the 404/Resource not found.