I am trying to host Dockerized Baserow on my server behind Nginx.
Getting this Error: could not connect to the api server
while trying to signup
Note
I have listed one configuration details including my docker comands but I almost have tried all methods listed on Baserow documentation.
Some resulted in 502 error, some in Website not found etc
Here is my current configuration details that is atleast showing me Some Signup UI:
Server: 22.04 LTS Server Management: CloudPanel Reverse Proxy: NGINIX
My 80 and 443 ports are being handled by NGINX so they are not free at all.
Here is my docker-compose.yml
# This is the recommended way of running Baserow using docker-compose for most users.
# See https://baserow.io/docs/installation%2Finstall-with-docker for more details.
version: "3.4"
services:
baserow:
container_name: baserow
image: baserow/baserow:1.24.2
environment:
BASEROW_PUBLIC_URL: 'https://baserow.amigrate.com:3006'
ports:
- "3005:80"
volumes:
- baserow_data:/baserow/data
volumes:
baserow_data:
Hi @ziach, there is some documentation available here: Installing Baserow behind Nginx // Baserow. Itβs important that the BASEROW_PUBLIC_URL matches the exact URL youβre visiting in your browser. If NGINX is listening on port 80 and 443, then the BASEROW_PUBLIC_URL must be equal to https://baserow.amigrate.com because thatβs the URL youβre visiting in your browser.
Would you be able to get your environment back into a state where it shows the registration form, and then share the HTTP network response when you get the Getting this Error: could not connect to the api server error?
One thing Iβve noticed you may want to check. You wrote that youβre using http://baserow.amigrate.com:3005 as the upstream address.
This seems to be a public address and my guess is nginx may not be able to connect to it (hence 502 error). If thatβs the case, you should set your upstream address to docker composeβs host (if youβre running nginx and compose on the same host, http://localhost:3005).
But because youβre using wrong proxy_pass value in Nginx, it canβt connect to the containers to proxy the traffic, hence HTTP 502 error.
Assuming youβre running Docker on the same host as youβre running nginx, for all-in-one setup you should set it to http://localhost:EXPOSED_PORT, to have the setup like this:
Hi @cezary !
Thank you for your valuable suggestions.
I tried different setups as per your recommendations but still nothing is working in my case.
I am trying from the last week and after trying almost every possible way according to documentation I did not succeed to make it work even for the single time.
I tried Nocodb, I was able to set it up very easily while I am stuck with Baserow and I am assuming that Baserow can provide more value and options for my team.
Now in order to make everything super simple I run my Baserow via this command:
and according to my docker logs everything is running properly.
But still I am not able to access my dashboard.
I am receiving this:
Site not found
The page you are looking for has not been found. This might be because URL is incorrect or that you donβt have permission to view this page.
Here is my assumption:
My container is running at http://127.0.0.1:3001
so it must at least be accessible via http://m_yIp:3001
But I am receiving site not found error.
My docker logs:
[STARTUP][2024-04-16 11:24:46] No DATABASE_HOST or DATABASE_URL provided, using embedded postgres.
[STARTUP][2024-04-16 11:24:46] Using embedded baserow redis as no REDIS_HOST or REDIS_URL provided.
[STARTUP][2024-04-16 11:24:46] Creating REDIS_PASSWORD secret in /baserow/data/.redispass
[STARTUP][2024-04-16 11:24:46] Importing REDIS_PASSWORD secret from /baserow/data/.redispass
[STARTUP][2024-04-16 11:24:46] Creating SECRET_KEY secret in /baserow/data/.secret
[STARTUP][2024-04-16 11:24:46] Importing SECRET_KEY secret from /baserow/data/.secret
[STARTUP][2024-04-16 11:24:46] Creating BASEROW_JWT_SIGNING_KEY secret in /baserow/data/.jwt_signing_key
[STARTUP][2024-04-16 11:24:46] Importing BASEROW_JWT_SIGNING_KEY secret from /baserow/data/.jwt_signing_key
[STARTUP][2024-04-16 11:24:46] Creating DATABASE_PASSWORD secret in /baserow/data/.pgpass
[STARTUP][2024-04-16 11:24:46] Importing DATABASE_PASSWORD secret from /baserow/data/.pgpass
=========================================================================================
βββββββ ββββββ βββββββββββββββββββββββ βββββββ βββ βββ
ββββββββββββββββββββββββββββββββββββββββββββββββββββ βββ
ββββββββββββββββββββββββββββββ βββββββββββ ββββββ ββ βββ
ββββββββββββββββββββββββββββββ βββββββββββ βββββββββββββ
βββββββββββ ββββββββββββββββββββββ ββββββββββββββββββββββ
βββββββ βββ ββββββββββββββββββββββ βββ βββββββ ββββββββ
Version 1.24.2
=========================================================================================
[STARTUP][2024-04-16 11:24:46] Running setup of embedded baserow database.
[POSTGRES_INIT][2024-04-16 11:24:49] Becoming postgres superuser to run setup SQL commands:
[POSTGRES_INIT][2024-04-16 11:24:49] CREATE DATABASE
[POSTGRES_INIT][2024-04-16 11:24:49] CREATE ROLE
[POSTGRES_INIT][2024-04-16 11:24:49] GRANT
[POSTGRES_INIT][2024-04-16 11:24:49] ALTER DATABASE
[POSTGRES_INIT][2024-04-16 11:24:49]
[POSTGRES_INIT][2024-04-16 11:24:49] PostgreSQL init process complete; ready for start up.
[POSTGRES_INIT][2024-04-16 11:24:49]
[STARTUP][2024-04-16 11:24:49] Starting Baserow using addresses http://127.0.0.1:3001, if any are https automatically Caddy will attempt to setup HTTPS automatically.
[STARTUP][2024-04-16 11:24:49] Starting all Baserow processes:
Your instance is available from http://127.0.0.1:3001 only (literally, this address needs to be typed into browserβs url bar) - this is the value youβve provided with BASEROW_PUBLIC_URL env variable.
You need:
set BASEROW_PUBLIC_URL env variable to http://baserow.xyz.com:$NGINX_PORT for Baserow containers. This value should point to Nginx endpoint. $NGINX_PORT is a non-standard port of Nginx (if youβre using such, and it seems you want to do that in this case).
set proxy_pass addresses to http://localhost:$DOCKER_EXPOSED_PORT in nginx configuration (assuming docker is running on the same host as nginx). $DOCKER_EXPOSED_PORT should be a port exposed by an appropriate container.
Those are two separate aspects of such deployment that need to be set up properly.