Mercurial > hg > nginx-tests
comparison http_try_files.t @ 659:f3b5bee3a14e
Tests: replaced underscores by hyphens in http_try_files.t.
author | Andrey Zelenkov <zelenkov@nginx.com> |
---|---|
date | Fri, 21 Aug 2015 16:12:56 +0300 |
parents | b9eb462d8973 |
children | 3200d5b4ffa8 |
comparison
equal
deleted
inserted
replaced
658:b9eb462d8973 | 659:f3b5bee3a14e |
---|---|
41 location / { | 41 location / { |
42 try_files $uri /fallback; | 42 try_files $uri /fallback; |
43 } | 43 } |
44 | 44 |
45 location /nouri/ { | 45 location /nouri/ { |
46 try_files $uri /fallback_nouri; | 46 try_files $uri /fallback-nouri; |
47 } | 47 } |
48 | 48 |
49 location /short/ { | 49 location /short/ { |
50 try_files /short $uri =404; | 50 try_files /short $uri =404; |
51 } | 51 } |
64 | 64 |
65 location /dir-file/ { | 65 location /dir-file/ { |
66 try_files /directory =404; | 66 try_files /directory =404; |
67 } | 67 } |
68 | 68 |
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/ { | 74 location /alias-nested/ { |
79 } | 79 } |
80 | 80 |
81 location /fallback { | 81 location /fallback { |
82 proxy_pass http://127.0.0.1:8081/fallback; | 82 proxy_pass http://127.0.0.1:8081/fallback; |
83 } | 83 } |
84 location /fallback_nouri { | 84 location /fallback-nouri { |
85 proxy_pass http://127.0.0.1:8081; | 85 proxy_pass http://127.0.0.1:8081; |
86 } | 86 } |
87 } | 87 } |
88 | 88 |
89 server { | 89 server { |
98 } | 98 } |
99 | 99 |
100 EOF | 100 EOF |
101 | 101 |
102 mkdir($t->testdir() . '/directory'); | 102 mkdir($t->testdir() . '/directory'); |
103 $t->write_file('directory/alias_re.html', 'SEE THIS'); | 103 $t->write_file('directory/alias-re.html', 'SEE THIS'); |
104 $t->write_file('found.html', 'SEE THIS'); | 104 $t->write_file('found.html', 'SEE THIS'); |
105 $t->run(); | 105 $t->run(); |
106 | 106 |
107 ############################################################################### | 107 ############################################################################### |
108 | 108 |
118 | 118 |
119 SKIP: { | 119 SKIP: { |
120 skip 'leaves coredump', 1 unless $t->has_version('1.9.4') | 120 skip 'leaves coredump', 1 unless $t->has_version('1.9.4') |
121 or $ENV{TEST_NGINX_UNSAFE}; | 121 or $ENV{TEST_NGINX_UNSAFE}; |
122 | 122 |
123 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'); |
124 | 124 |
125 } | 125 } |
126 | 126 |
127 TODO: { | 127 TODO: { |
128 local $TODO = 'not yet' unless $t->has_version('1.9.4'); | 128 local $TODO = 'not yet' unless $t->has_version('1.9.4'); |