# HG changeset patch # User Andrey Zelenkov # Date 1440161945 -10800 # Node ID b9eb462d8973725a17bd0b1c2d704b669f416524 # Parent 68a95e3195f19117f50c302a8c794df7bd130656 Tests: added try_files test for alias with nested location. diff --git a/http_try_files.t b/http_try_files.t --- a/http_try_files.t +++ b/http_try_files.t @@ -21,7 +21,7 @@ use Test::Nginx; select STDERR; $| = 1; select STDOUT; $| = 1; -my $t = Test::Nginx->new()->has(qw/http proxy rewrite/)->plan(9) +my $t = Test::Nginx->new()->has(qw/http proxy rewrite/)->plan(10) ->write_file_expand('nginx.conf', <<'EOF'); %%TEST_GLOBALS%% @@ -71,6 +71,13 @@ http { try_files $uri =404; } + location /alias-nested/ { + alias %%TESTDIR%%/; + location ~ html { + try_files $uri =404; + } + } + location /fallback { proxy_pass http://127.0.0.1:8081/fallback; } @@ -117,4 +124,12 @@ like(http_get('/alias_re.html'), qr!SEE } +TODO: { +local $TODO = 'not yet' unless $t->has_version('1.9.4'); + +like(http_get('/alias-nested/found.html'), qr!SEE THIS!, + 'alias with nested location'); + +} + ###############################################################################