Answer the question
In order to leave comments, you need to log in
How to redirect to a file on a subdomain via nginx?
Good day.
Help, please solve a simple (for those who know) problem, because I myself am almost not friends with nginx, but they didn’t take the time to figure it out.
The bottom line is, there is a site, files are uploaded in batches to a certain section, and the files are available at approximately the following address: site.ru/files/10-23/aaabbbccc/222.txt
Once a day at night, the files uploaded for this day are sent to the cloud . The cloud is tied to the site as a subdomain, and that file is already becoming available at images.site.ru/files/10-23/aaabbbccc/222.txt
The files folder on the site has .htaccess with a redirect rule for such a case.
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ http://images.site.ru/files/$1
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question