Problem Summary
I’m encountering a 404 error when accessing an image upload via its URL on the live Discourse site (https://techenclave.com
), even though the image is present on disk and served correctly internally. I’ve rebaked the post, restarted the app, and verified internal serving works, but it still 404s externally.
What’s Working
1. Upload Exists in DB
Using the Rails console, I confirmed that the upload exists with all correct metadata:
Upload.find_by(sha1: 'a8fbe877e685e6a6994532c946c446b1279da7d2')
Output includes:
url: "/uploads/default/original/3X/a/8/a8fbe877e685e6a6994532c946c446b1279da7d2.jpeg"
- Filename:
IMG202506252257011.jpg
- ID:
170265
- Used in Post ID:
3125774
2. File Exists on Disk
Verified file is present inside the container:
ls -l /shared/uploads/default/original/3X/a/8/a8fbe877e685e6a6994532c946c446b1279da7d2.jpeg
File exists with correct ownership and permissions:
discourse:www-data
, -rw-r--r--
.
3. Symlink from Public Folder Works
The public/uploads
symlink is intact:
ls -l /var/www/discourse/public/uploads
# => /shared/uploads
4. Discourse Can Serve It Internally
Tested with:
curl -I http://localhost:3000/uploads/default/original/3X/a/8/a8fbe877e685e6a6994532c946c446b1279da7d2.jpeg
Result: HTTP/1.1 200 OK
5. Post Rebaked
Rebaked the post with:
Post.find(3125774).rebake!
6. App Restarted
Ran:
./launcher restart app
Also attempted:
sudo ./launcher rebuild app
(Docker daemon was temporarily unavailable but later fixed.)
What’s Not Working
External Access to Image
Accessing:
https://techenclave.com/uploads/default/original/3X/a/8/a8fbe877e685e6a6994532c946c446b1279da7d2.jpeg
Returns:
404 Not Found
This happens across browsers and in incognito mode.
What I Need Help With
Can someone help identify what could cause:
- A working upload that serves via
localhost:3000
, - but returns 404 externally on the public domain?
What else should I check? Any related config or logs to inspect?
Thanks in advance!