Quantcast
Channel: Nginx Forum - How to...
Viewing all articles
Browse latest Browse all 4759

try_files brain crack

$
0
0
I want convert url like http://mysite.com/private/user1/file1.dat
to destination file as /host/userfiles/user1/private/file1.dat

I try this:
location ~/private/(.*)[/]?(.*)$ {
root /host/userfiles/$1/private;

try_files $2 @files_private_failed;
}
This example fallback to @files_private_failed.
Debugging shows that regexp vals $1 = "user1", $2="file1.dat". So, they are correct
The file /host/userfiles/user1/private/file1.dat also exists, with correct perms.

What is wrong with config?

Viewing all articles
Browse latest Browse all 4759

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>