Skip to content

Instantly share code, notes, and snippets.

@zzzcpan
Created Jul 20, 2012
Embed
What would you like to do?
perl_set $dice 'sub {
if (@pool) {
push @pool, shift @pool;
} else {
@pool = ("/test1", "/test2");
}
my $r = shift;
my $root = $r->variable("document_root");
my $uri = $r->uri;
foreach my $path (@pool) {
if (-f "$root/$path$uri") {
return "$path$uri";
}
}
return "";
}';
server {
location / {
try_files $dice =404;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment