Twenty behind NGINX reverse proxy

Im trying to self host Twenty using docker compose and NGINX. I just followed the tutorial in the page, and altered SERVER_URL at .env to be my domain. I can access the page and use the entire system with no problems. When i try to use the API, however, it times out every time. If i change SERVER_URL back to localhost, the API works, but i can no longer access the web part using my domain (expected). What im a missing? I tried changing FRONT_BASE_URL, but no effect.
47 Replies
charles
charles2mo ago
Hi @Marcelo Granzotto, sorry for the slow answer. So Twenty is working fine but you cannot access the API on your_server_url/graphql? could you share you network tab (browser developer console) while browsing twenty?
Marcelo Granzotto
i cannot access the /rest API. In the browser everything works, but in a console it only works if i have twenty configured to be on localhost. My work around was to have two instances connected to the same DB in the browser there is nothing weird. The API just does not work in the custom domain for me the setup: -NGINX for reverse proxy -Twenty running with custom https domain -The web UI works, the API does not (on any device, even local)
charles
charles2mo ago
Can you browse: https://api.twenty.com/graphql ? (replacing api.twenty.com with your domain)
Marcelo Granzotto
it opens
charles
charles2mo ago
Marcelo Granzotto
here it just loads forever
charles
charles2mo ago
Select "Other" and put your url
Marcelo Granzotto
i will show you, just a sec
Marcelo Granzotto
the only request that works is this first one /open-api. All the rest load forever, unless i use twenty at localhost
charles
charles2mo ago
Ok! I think I know where this come from Right now the Rest API is leveraging the GraphqlAPI (we plan to change it later this year)... over HTTP this means that when you make a /rest query, it is parsing it, making graphql and sending an http request to the /graphql endpoint
Marcelo Granzotto
oh i see
charles
charles2mo ago
From the REST point of view, here is the graphql domain: const baseUrl = getServerUrl( request, this.environmentService.get('SERVER_URL'), ); It's there: https://github.com/twentyhq/twenty/blob/0f75e14ab25f2893d288024db1ff7c616a6966d7/packages/twenty-server/src/engine/api/rest/rest-api.service.ts#L30
Marcelo Granzotto
is there something i can do? Or just run two instances for now
Want results from more Discord servers?
Add your server