Is it possible to override tyk_api_config.Host with an environment variable?

Hi all!
I don’t know if this is a bug or a “feature”, but I’m not actually able to override the value tyk_api_config.Host for the Dashboard using an environment variable.

According to the documentation and on how to convert configuration settings in environment variables, I defined the following environment variable in my docker-compose: TYK_DB_TYKAPICONFIG_HOST: "http://tyk-gateway", but then I get always the following error:

time=“Jul 16 17:03:37” level=error msg=“Failed to get certificates: Get http://tyk_gateway:8080/tyk/certs/?org_id=5d2df5cf3ae1b70001f902c2: dial tcp: lookup tyk_gateway on 127.0.0.11:53: server misbehaving”

… and, if I check the configuration file of the Dashboard, I can actually find http://tyk_gateway as host although it should have been rewritten.

Thank you for the help,

  • cdprete

I assume you mean you have TYK_DB_TYKAPICONFIG_HOST= "http://tyk-gateway" and not with a colon?

Yes, sorry.
I copied the wrong file. You’re right.

@cdprete This setting is an exception to the Env Var rule. The correct env var for this config setting is TYK_DB_TYKAPI_HOST

I’ll be updating the Env Var docs.

1 Like

Ok, good to know.
In the end, while waiting, I mounted the tyk.conf file so I’m changing the configuration directly there, so it’s not really an issue anymore.

@marks Was this updated in the docs? I don’t see mention of it. //tyk.io/docs/tyk-environment-variables/

@sedky

1 Like

save my day, but pls update at the document as well: //tyk.io/docs/tyk-environment-variables/ :sweat_smile:

1 Like