Cannot Serve Backend Uploads Folder via OpenLiteSpeed Reverse Proxy – Getting 404

#1
Hi everyone, I’m a newbie trying to figure this out.


I’m using OpenLiteSpeed as a reverse proxy for my setup:


  • Frontend: React app served via OpenLiteSpeed
  • Backend: Node.js/Express app running separately (Invoice Backend). In Server Configuration, I added an External App with address localhost:5000.
  • Uploaded files: Stored in the backend’s /uploads/ folder
  • Express static setup:
app.use("/uploads", express.static(path.join(process.cwd(), "uploads")));
What I want:
Make files from /uploads/ accessible publicly so I can display them in my frontend, e.g., https://mydomain.com/uploads/filename.jpeg.

What I tried:
  1. Proxy context for API:
    • URI: /api/ → Web Server: Invoice Backend (Node.js)
    • Works fine for API requests.
  2. Proxy context for uploads:
  3. Static context attempt:
    • Tried creating a static context pointing directly to the backend /uploads/ folder.
    • Virtual host root is set to the frontend build folder.
Issue:
Even though the file exists on the backend and is accessible via localhost:5000/uploads/filename.jpeg, OpenLiteSpeed is not serving it through the /uploads/ proxy context or the static context. Permissions are fine.


Question:
Has anyone successfully served a backend /uploads/ folder through OpenLiteSpeed as a reverse proxy while keeping API routes working? Am I missing some configuration? How can I make these files publicly accessible without getting 404?
 

Attachments

Top