Skip to content
Back

Avatar URLs are using server IP address instead of configured domain

  • 0
  • 2
  • Self Hosted
  • Web
sudarsan25
29 Nov, 2025, 02:22

Issue: Avatar URLs are using server IP address instead of configured domain Environment:

Appwrite Version: 1.8.0 Setup: Self-hosted on Google Compute Engine with Cloudflare Tunnel Domain: <your-domain> Frontend: Firebase Hosting at <your-frontend-domain>

Problem: The avatars.getInitials() endpoint is generating URLs with the server's IP address instead of the configured domain:

Current (wrong): http://<public-ip>/v1/avatars/initials?name=User&project=<project-id> Expected: https://<your-domain>/v1/avatars/initials?name=User&project=<project-id>

This causes:

ERR_CERT_AUTHORITY_INVALID errors (IP has no SSL cert) Mixed content warnings (HTTP images on HTTPS page) Blocked image requests

Configuration: All environment variables are correctly set in both .env and docker-compose.yml: bash_APP_DOMAIN=<your-domain> _APP_DOMAIN_TARGET=<your-domain> _APP_DOMAIN_FUNCTIONS=<your-domain> _APP_ENDPOINT=https://<your-domain>/v1 Verified: bashdocker exec -it appwrite printenv | grep APP_DOMAIN

Shows all domain variables are correct

Steps Taken:

Restarted Appwrite multiple times Cleared browser cache Added platform for frontend domain in Appwrite console Verified Cloudflare Tunnel is working correctly (other API endpoints work fine)

Question: Why is the avatar service still generating URLs with the IP address? Is there a cached value in the database or a specific configuration for the avatar service we're missing?

TL;DR
Issue: Avatar URLs are showing the server IP address instead of the configured domain. Solution: The user will fix the issue.
sudarsan25
29 Nov, 2025, 02:23

I been in the issue from yesterday

sudarsan25
29 Nov, 2025, 02:25

My appwrite is self hsoted in gcp and I have used cloudfalre tunnel for it.Console is opening from my subdomain adn data are allso being fetch from db.But avatar are not showing

Steven
29 Nov, 2025, 02:44

You're passing an IP address into client.setEndpoint()

Steven
29 Nov, 2025, 02:45

Get initials doesn't make any api call. It just builds the url and returns it. See https://github.com/appwrite/sdk-for-web/blob/de72141ece55b1eb4e8d14b8bf429c3b8bf690ce/src/services/avatars.ts#L461

sudarsan25
29 Nov, 2025, 02:52

No,I am not passing .I am passing subdomain url.import { Client, Account, Databases, Storage, Avatars } from 'appwrite'

export const appwriteConfig = { projectId: import.meta.env.VITE_APPWRITE_PROJECT_ID, url: import.meta.env.VITE_APPWRITE_URL, databaseId: import.meta.env.VITE_APPWRITE_DATABASE_ID, storageId: import.meta.env.VITE_APPWRITE_STORAGE_ID, userCollectionId: import.meta.env.VITE_APPWRITE_USERS_COLLECTION_ID, postCollectionId: import.meta.env.VITE_APPWRITE_POSTS_COLLECTION_ID, savesCollectionId: import.meta.env.VITE_APPWRITE_SAVES_COLLECTION_ID, commentsCollectionId: import.meta.env.VITE_APPWRITE_COMMENTS_COLLECTION_ID, followCollectionId: import.meta.env.VITE_APPWRITE_FOLLOW_COLLECTION_ID }

export const client = new Client(); client.setProject(appwriteConfig.projectId) client.setEndpoint(appwriteConfig.url)

export const account = new Account(client); export const databases = new Databases(client); export const storage = new Storage(client); export const avatars = new Avatars(client);

sudarsan25
29 Nov, 2025, 02:53

environment variable is set and I have rebuild and deplyed too by clearing cache.Everyone is requesting in subdomainurl but while fetching avatar url,it using http:<my public ip>

Steven
29 Nov, 2025, 02:55

Before you call avatars.getInitials() can you log avatars.client.config?

And can you confirm which Appwrite SDK you're using and what version?

sudarsan25
29 Nov, 2025, 02:59

I need some time

29 Nov, 2025, 03:10

GET https://<my_vm public_ip>/v1/avatars/initials?name=Testproduser&project=6928397b00217571c01f net::ERR_CERT_AUTHORITY_INVALID

29 Nov, 2025, 03:13

"appwrite": "^17.0.2" in package.json

29 Nov, 2025, 03:14

Appwrite Version: 1.8.0 in self hosting

29 Nov, 2025, 03:16

Weird...this doesn't make sense...

29 Nov, 2025, 03:17

Also, your SDK version is really old

29 Nov, 2025, 03:17

exactly..I been debugging from yesterday

29 Nov, 2025, 03:18

Would you please share your code here?

29 Nov, 2025, 03:18

Even in this old version, the url is generated using the client.config.endpoint

https://github.com/appwrite/sdk-for-web/blob/16b9d2fa145cb288ecb4ea7367fdbbb11dedd293/src/services/avatars.ts#L239

29 Nov, 2025, 03:20

I have share something to look into in your personal chat too

29 Nov, 2025, 03:23

Maybe the issue is in my backend..I am using cloudflare tunnel for ssl certification and https but since the backend send the url of ip?i dont know

29 Nov, 2025, 03:32

No like I said twice, there is no backend involved

29 Nov, 2025, 03:33

Please share your code

29 Nov, 2025, 03:46

Oh now I know..this was stupid mistake..lol Actually,I used my ip for storing user record previously and now after setting subdomain,the previous image url are not going to change from db.

1
29 Nov, 2025, 03:46

I will fix that..thank you

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