Hi everyone, I’m a newbie trying to figure this out.
I’m using OpenLiteSpeed as a reverse proxy for my setup:
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:
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?
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:
- On localhost, accessing files via http://localhost:5000/uploads/filename.jpeg works fine.
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:
- Proxy context for API:
- URI: /api/ → Web Server: Invoice Backend (Node.js)
- Works fine for API requests.
- Proxy context for uploads:
- URI: /uploads/ → Web Server: Invoice Backend (Node.js)
- Tried accessing https://mydomain.com/uploads/filename.jpeg → Still getting 404 Not Found
- 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.
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
-
341.3 KB Views: 1