https://www.growthbook.io/ logo
#announcements
Title
# announcements
b

blue-hamburger-60411

04/19/2023, 3:22 AM
Hi, I'm trying to get production setup working for self hosted growthbook instance. I have Kong as gateway in front of growthbook app and api instances.
Copy code
docker-compose.yml config
  growthbook:
    environment:
      - MONGODB_URI=<mongodb://root:xxx@mongo:27017/>
      - APP_ORIGIN=<https://growthbook.example.com>
      - API_HOST=<https://growthbook-api.example.com>
      - NODE_ENV=production
      - JWT_SECRET=qwertyuiopasdfghjklzxcvbnmertyui
      - ENCRYPTION_KEY=qwertyuiosdfghnjmxcvbnmdfghj


GET <https://growthbook-api.example.com/>
Response
{"name":"GrowthBook API","production":true,"api_host":"<http://growthbook-api.example.com:3100>","app_origin":"<https://growthbook.example.com>","config_source":"db","email_enabled":false,"build":{"sha":"2dca1f35ceb8ff9748f380cfb6aa481a45109b2b","date":"2023-03-17T18:06:14Z"}}

GET <https://growthbook-api.example.com/organization>
Response
{"status":401,"message":"No authorization token was found"}
[1] Why is api_host in response shown as "http://growthbook-api.example.com:3100", config has this set as "https://growthbook-api.example.com" [2] How do I resolve missing token issue, will appreciate any pointers. Thank you 🙏
f

fresh-football-47124

04/19/2023, 9:06 AM
It should be showing you the values of APP_ORIGIN and API_HOST. If you want to run on a custom port (like 443) you must adjust the ports in the environment variables. If you need to change the ports on your local dev environment (e.g. if
3000
is already being used), you need to update the above variables AND change the port mapping in `docker-compose.yml`: growthbook: ports: - “4000:3000” # example: use 4000 instead of 3000 for the app - “4100:3100" # example: use 4100 instead of 3100 for the api ... environment: - APP_ORIGIN=http://<my ip or url>:4000 - API_HOST=http://<my ip or url>:4100
b

blue-hamburger-60411

04/19/2023, 9:23 AM
I have updated the config as per these instructions only. GB app and api are running on default ports, https is handled by the gateway layer and it forwards requests to ports 3000 and 3100 on the GB instance. I'm now able to create login and access GB interface, however my previous features and experiment config are not available. I'm recreating them from scratch.
15 Views