Answer the question
In order to leave comments, you need to log in
How to send images from the Nginx server to the client?
A React project (client) and Express.js api are running on a dedicated server.
Implemented via proxy_pass, everything works.
Api implements the loading of images along the path /api/tmp.
Express has static handling of this folder enabled.
The problem is, nginx doesn't return images if I go to domain.ru/api/tmp.
Answer the question
In order to leave comments, you need to log in
1. paste the code as text, not as an image
2. read the error log from nginx
See how I did it, by the way, look for my question about nginx, it describes how to make a structure, the controller itself either gives the full path to the nginx location, or if this dynamic redirects to the same picture, as a result, everyone does their own thing, in general, the api distributes pictures and does not know where they are stored and nginx returns the static and caches it
Added a link to my question How to overwrite the file name in a subfolder for Nginx?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question