I
I
Ivan2019-10-13 17:02:46
Nginx
Ivan, 2019-10-13 17:02:46

How to forward static requests through nginx?

Hello! Can you please tell me how to redirect nginx requests for static?
example: a user asks us for an image from the site site.ru/uploads/image.jpg
and nginx pulls the image from another address, for example cdn.site.ru/image.jpg
How to do this?
In general, I just want to connect to CDN Selectel, but I can’t find a travel guide anywhere.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
L
Lynn "Coffee Man", 2019-10-13
@Lynn

proxy_pass
Only you are doing something weird. CDNs are usually connected just to offload their server, so that clients go for static bypassing your server.

F
Fixid, 2019-10-13
@Fixid

proxy_pass module

A
arroway, 2019-10-13
@arroway

Hey!
Selectel has a "Cloud storage" section in its knowledge base - https://kb.selectel.ru/23136007.html . There are instructions on how to work with the repository and distribute static data.
Inside there is a subsection "Using a CDN" - https://kb.selectel.ru/24380446.html (how to connect CDN Selectel, which providers have CDNs in general, about clearing the cache and disabling).
There is also a large CDN section - https://kb.selectel.ru/42077358.html. There, in general, about everything and instructions for connecting.
If you need advice on working with nginx or need to implement something specific, you can register in the control panel https://my.selectel.ru/login/and write a ticket with questions - the guys from technical support will try to give advice.
You can also call +7 (800) 555-06-75, tell about your task, and pre-sale engineers will help organize a solution.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question