Welcome! Log In Create A New Profile

Advanced

try_files brain crack

Posted by eurobax 
try_files brain crack
July 12, 2014 02:29PM
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?
Re: try_files brain crack
July 12, 2014 04:04PM
I've just found solution

wrong: try_files $2
right : try_files /$2

So, can you explain me, is this a hack or documented case?



Edited 1 time(s). Last edit at 07/12/2014 04:04PM by eurobax.
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 181
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready