nginx提供文件,但不是动态目录中的所有文件

nginx提供文件,但不是动态目录中的所有文件,nginx,Nginx,我想在nginx服务器上提供文件 服务位置/home/ubuntu/username/fileName eg1/home/ubuntu/john/d1.txt eg2/home/ubuntu/john/d2.txt eg3/home/ubuntu/kiddo/d3.txt 它不可使用访问 location ~ /home/ubuntu/(?<user>.+)/(?<file>.+)$ { root /home/ubuntu/$user/$file;

我想在nginx服务器上提供文件

服务位置/home/ubuntu/username/fileName
eg1/home/ubuntu/john/d1.txt
eg2/home/ubuntu/john/d2.txt
eg3/home/ubuntu/kiddo/d3.txt

它不可使用访问

location ~ /home/ubuntu/(?<user>.+)/(?<file>.+)$ {
            root /home/ubuntu/$user/$file;
}
location~/home/ubuntu/(?。+)/(?。+)${
root/home/ubuntu/$user/$file;
}

根据您展示的样品,请尝试以下内容。请确保在测试URL之前清除浏览器缓存

location ~ /home/ubuntu/([^/]*)/([^/]*)/?$ {
            root /home/ubuntu/$1/$2;
}

不工作。用户为pbh.ind,文件为queue_97b7743a-fc46-4da5-ba21-52256df1e6f8。wav@patabhu,好的,请你现在检查一下,让我知道情况如何?不行。还尝试授予权限755&所有者根。@patabhu,确定您正在访问的url是什么吗?url->