Skip to content
Back

[CLOSED] Bad Gateway on host Appwrite with Nginx

  • 0
  • Self Hosted
Milukun
25 May, 2023, 12:25

i use docker cmd to create appwrite on my vps:

TypeScript
docker run -it --rm \
    --volume /var/run/docker.sock:/var/run/docker.sock \
    --volume "$(pwd)"/appwrite:/usr/src/code/appwrite:rw \
    --entrypoint="install" \
    appwrite/appwrite:1.3.4

and set port to 9980 and 9443 , The rest of the settings are “localhost”

I want to use Nginx inside my VPS for reverse proxy, using the configuration in this post: https://github.com/appwrite/appwrite/discussions/4329 And I have set up my domain SSL

But when I access my https domain, I get a 502 Bad Gateway

What should I do? I found the following error in the docker log, Keeps reappearing over and over again

TypeScript
Failed: Query has failed: Request failed! curl_errno: 7
#0 /usr/src/code/vendor/influxdb/influxdb-php/src/InfluxDB/Database.php(78): InfluxDB\Client->query('telegraf', 'SELECT sum(valu...', Array)
#1 /usr/src/code/src/Appwrite/Usage/Calculators/TimeSeries.php(476): InfluxDB\Database->query('SELECT sum(valu...')
#2 /usr/src/code/src/Appwrite/Usage/Calculators/TimeSeries.php(528): Appwrite\Usage\Calculators\TimeSeries->syncFromInfluxDB('databases.$all....', Array, Array)
#3 /usr/src/code/app/tasks/usage.php(132): Appwrite\Usage\Calculators\TimeSeries->collect()
#4 /usr/src/code/vendor/utopia-php/cli/src/CLI/Console.php(208): {closure}()
#5 /usr/src/code/app/tasks/usage.php(137): Utopia\CLI\Console::loop(Object(Closure), 30)
#6 /usr/src/code/vendor/utopia-php/cli/src/CLI/CLI.php(233): {closure}()
#7 /usr/src/code/app/cli.php(32): Utopia\CLI\CLI->run()
#8 {main}

Should I set my own domain name when I start appwrite? But the domain name may change later too

This is my Nginx config [see config.txt]

TL;DR
The user experienced a Bad Gateway error while using Nginx with AppWrite. They found that the database failed to start due to not starting the service with root. After resolving the root issue, the problem was fixed. The user also mentioned using Docker to create AppWrite and Nginx for reverse proxy with SSL. They shared their Nginx configuration and Docker command. Solution: The user did not mention any specific solution, but they were able to resolve the issue by starting the service with root.
Binyamin
25 May, 2023, 12:46

Can you run docker ps and share the results?

Milukun
25 May, 2023, 12:59

Thank you for your reply, I use docker exec appwrite doctor I checked my service and found that the database failed to start, I found that it was caused by not starting the service with root. It has just worked fine, thanks!

joeyouss
25 May, 2023, 13:07

[CLOSED] Bad Gateway on host AppWrite with Nginx

joeyouss
25 May, 2023, 13:07

glad you made it work @Milukun

Drake
26 May, 2023, 15:37

[CLOSED] Bad Gateway on host Appwrite with Nginx

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more