Tests: added test for try_files in regex location with alias.
It was broken by c985d90a8d1f.
diff --git a/http_try_files.t b/http_try_files.t
index 59e0f18..39d1c17 100644
--- a/http_try_files.t
+++ b/http_try_files.t
@@ -21,7 +21,7 @@
select STDERR; $| = 1;
select STDOUT; $| = 1;
-my $t = Test::Nginx->new()->has(qw/http proxy rewrite/)->plan(8)
+my $t = Test::Nginx->new()->has(qw/http proxy rewrite/)->plan(9)
->write_file_expand('nginx.conf', <<'EOF');
%%TEST_GLOBALS%%
@@ -66,6 +66,11 @@
try_files /directory =404;
}
+ location ~ /alias_re.html {
+ alias %%TESTDIR%%/directory;
+ try_files $uri =404;
+ }
+
location /fallback {
proxy_pass http://127.0.0.1:8081/fallback;
}
@@ -88,6 +93,7 @@
EOF
mkdir($t->testdir() . '/directory');
+$t->write_file('directory/alias_re.html', 'SEE THIS');
$t->write_file('found.html', 'SEE THIS');
$t->run();
@@ -103,4 +109,11 @@
like(http_get('/dir-dir/'), qr!301 Moved Permanently!, 'dir matches dir');
like(http_get('/dir-file/'), qr!404 Not!, 'dir does not match file');
+SKIP: {
+skip 'leaves coredump', 1 unless $ENV{TEST_NGINX_UNSAFE};
+
+like(http_get('/alias_re.html'), qr!SEE THIS!, 'alias in regex location');
+
+}
+
###############################################################################