From inside the container: ```curl <http://localho...
# announcements
b
From inside the container:
Copy code
curl <http://localhost:3100>
{"name":"GrowthBook API","production":true,"api_host":"<http://localhost:3100>","app_origin":"<https://localhost:3000>","config_source":"db","email_enabled":false,"build":{"sha":"cf216ccc76a9d54e4bd793781e3e1d2e45385548","date":"2023-05-18T14:47:09Z"}}root@growthbook-api-web-685f59dbdf-fgxvn:/usr/local/src/app#
So why is the frontend unable to communicate with the API?
f
Are you getting a CORS error or any other message in console?
you can set an environment variable: CORS_ORIGIN_REGEX to match the domains GrowthBook is running on
b
I mage the change that @happy-autumn-40938 suggested using
Copy code
APP_ORIGIN: <https://my.growthbook.mydomain.com>
        API_HOST: <https://my.growthbook.mydomain.com>
but now I am getting
The question is: the front end is trying to connect to the backend using the value of
API_HOST
? Is so, why is failing given that
<http://localhost:3100>
works from inside the pod?
f
using the same value for APP_ORIGIN and API_HOST wont work
it will send api request to itself - which will return html, as youโ€™re seeing there
I think you were very close to getting it to work
๐Ÿ’š 1
๐Ÿ™ 1
b
So given that the instance is exposed at
<https://my.growthbook.mydomain.com>
what should the values for
API_HOST
/
APP_ORIGIN
be?
f
The API_HOST must be a routable address to the api container from the front end app. The APP_ORIGIN is used for the CORS headers to make sure the request from the front end is from the right host.
๐Ÿ‘ 1