D
D
Dima Pautov2018-12-20 15:33:44
Nginx
Dima Pautov, 2018-12-20 15:33:44

How to give a file to a specific location from a specific folder?

Good afternoon! Perhaps I didn’t formulate the question correctly, but I’ve been struggling for half an hour and I can’t correctly formulate the query in Google. What is my problem.
I have a website, I want to make a sitemap.
I want it to be served along this path mysite.ru/sitemap.xml
The map site itself is located in a certain folder /uploads/sitemaps.
I need a sitemap from the /uploads/sitemaps/sitemap.xml folder when visiting mysite.ru/sitemap.xml.
Please help or at least tell me what to google

Answer the question

In order to leave comments, you need to log in

2 answer(s)
P
Peter, 2018-12-20
@petermzg

location /sitemap.xml { alias /uploads/sitemaps/sitemap.xml; }
or
location /sitemap.xml { root /uploads/sitemaps/; }

K
ky0, 2018-12-20
@ky0

Google and you will open the gates of knowledge! (c) your signature

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question