comparison http_try_files.t @ 658:b9eb462d8973

Tests: added try_files test for alias with nested location.
author Andrey Zelenkov <zelenkov@nginx.com>
date Fri, 21 Aug 2015 15:59:05 +0300
parents 68a95e3195f1
children f3b5bee3a14e
comparison
equal deleted inserted replaced
657:68a95e3195f1 658:b9eb462d8973
19 ############################################################################### 19 ###############################################################################
20 20
21 select STDERR; $| = 1; 21 select STDERR; $| = 1;
22 select STDOUT; $| = 1; 22 select STDOUT; $| = 1;
23 23
24 my $t = Test::Nginx->new()->has(qw/http proxy rewrite/)->plan(9) 24 my $t = Test::Nginx->new()->has(qw/http proxy rewrite/)->plan(10)
25 ->write_file_expand('nginx.conf', <<'EOF'); 25 ->write_file_expand('nginx.conf', <<'EOF');
26 26
27 %%TEST_GLOBALS%% 27 %%TEST_GLOBALS%%
28 28
29 daemon off; 29 daemon off;
69 location ~ /alias_re.html { 69 location ~ /alias_re.html {
70 alias %%TESTDIR%%/directory; 70 alias %%TESTDIR%%/directory;
71 try_files $uri =404; 71 try_files $uri =404;
72 } 72 }
73 73
74 location /alias-nested/ {
75 alias %%TESTDIR%%/;
76 location ~ html {
77 try_files $uri =404;
78 }
79 }
80
74 location /fallback { 81 location /fallback {
75 proxy_pass http://127.0.0.1:8081/fallback; 82 proxy_pass http://127.0.0.1:8081/fallback;
76 } 83 }
77 location /fallback_nouri { 84 location /fallback_nouri {
78 proxy_pass http://127.0.0.1:8081; 85 proxy_pass http://127.0.0.1:8081;
115 122
116 like(http_get('/alias_re.html'), qr!SEE THIS!, 'alias in regex location'); 123 like(http_get('/alias_re.html'), qr!SEE THIS!, 'alias in regex location');
117 124
118 } 125 }
119 126
127 TODO: {
128 local $TODO = 'not yet' unless $t->has_version('1.9.4');
129
130 like(http_get('/alias-nested/found.html'), qr!SEE THIS!,
131 'alias with nested location');
132
133 }
134
120 ############################################################################### 135 ###############################################################################