Answer the question
In order to leave comments, you need to log in
How to write nginx location with regular expression on alias?
Those that are:
location ~ ^/video/.+\.m3u8|ts$ {
root /var/www/html/;
location ~ /video/^.+\.m3u8|ts$ {
alias /var/www/my_video/$1;
Answer the question
In order to leave comments, you need to log in
If you just look for files in this folder.
location ~ /video/^.+\.(m3u8|ts)$ {
alias /var/www/my_video/;
try_files $uri =404;
}
location ~^ /video/^(.+)\.(m3u8|ts)$ {
alias /var/www/my_video/$1/;
try_files $uri =404;
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question