F
F
fateseekers2020-06-20 15:53:57
Nginx
fateseekers, 2020-06-20 15:53:57

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.

5eee06dd73e9b299731764.png

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dr. Bacon, 2020-06-20
@bacon

1. paste the code as text, not as an image
2. read the error log from nginx

V
Vladimir Korotenko, 2020-06-20
@firedragon

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 question

Ask a Question

731 491 924 answers to any question