Skip to content
Back

Self hosted cors block , flutter web

  • 1
  • Self Hosted
  • Flutter
abolfazl27.
22 Apr, 2025, 18:07

we have appwrite instance running on a VPS with ip of 192.168.1.75 on Docker ! then

i have add A record in cloudflare and mapped the ip to domain of app.kajelevator.ir

also i built web flutter application deployed on cloudflare pages and mapping the custom domain of it to kajelevator.ir that effected DNS configurations in cluodflare to have a CNAME record with kajelevator.ir content kajelevator.pages.dev

Now the record look like this

type name content

A app 192.168.1.75

CNAME kajelevator.ir kajelevator.pages.dev

now from flutter pwa witch is kajelevator.ir when i send request to my app instance i got a CORS error. how to fix it ?

with reserch and using ai i have edited .env file of docker with following things

.env _APP_DOMAIN_TARGET=app.kajelevator.ir _APP_DOMAIN=kajelevator.ir _APP_CORS_ALLOW_ORIGIN=https://kajelevator.ir

but the error persist and the error is this:

TL;DR
Developers have a Flutter web app hosted on Cloudflare, encountering a CORS error when sending requests to their Appwrite instance on a VPS. They have updated the .env file in Docker with CORS settings but the error persists.
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