# HG changeset patch # User Maxim Dounin # Date 1335262919 -14400 # Node ID 35d050d7d5f1e412e85a86e8da67fb9dcc4cef41 # Parent 4ac0807cc3cf164b8e3c3adca50801d0c78c9456 Tests: add try_files test with short uri (ticket #152). 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 rewrite/)->plan(3) +my $t = Test::Nginx->new()->has(qw/http rewrite/)->plan(4) ->write_file_expand('nginx.conf', <<'EOF'); %%TEST_GLOBALS%% @@ -46,6 +46,10 @@ http { try_files $uri /fallback_nouri; } + location /short/ { + try_files /short $uri =404; + } + location /fallback { proxy_pass http://127.0.0.1:8081/fallback; } @@ -74,6 +78,7 @@ EOF like(http_get('/found.html'), qr!SEE THIS!, 'found'); like(http_get('/uri/notfound'), qr!X-URI: /fallback!, 'not found uri'); +like(http_get('/short/long'), qr!404 Not!, 'short uri in try_files'); TODO: { local $TODO = 'fixed in 1.1.12';