allow directories in try_files
Igor Sysoev
13 years ago
1037 | 1037 | ssize_t reserve, allocated; |
1038 | 1038 | u_char *p, *name; |
1039 | 1039 | ngx_str_t path; |
1040 | ngx_uint_t test_dir; | |
1040 | 1041 | ngx_http_try_file_t *tf; |
1041 | 1042 | ngx_open_file_info_t of; |
1042 | 1043 | ngx_http_script_code_pt code; |
1131 | 1132 | path.len -= alias; |
1132 | 1133 | } |
1133 | 1134 | } |
1135 | ||
1136 | test_dir = tf->test_dir; | |
1134 | 1137 | |
1135 | 1138 | tf++; |
1136 | 1139 | |
1171 | 1174 | continue; |
1172 | 1175 | } |
1173 | 1176 | |
1174 | if (!of.is_file) { | |
1177 | if (of.is_dir && !test_dir) { | |
1175 | 1178 | continue; |
1176 | 1179 | } |
1177 | 1180 | |
3852 | 3855 | |
3853 | 3856 | tf[i].name = value[i + 1]; |
3854 | 3857 | |
3858 | if (tf[i].name.data[tf[i].name.len - 1] == '/') { | |
3859 | tf[i].test_dir = 1; | |
3860 | tf[i].name.len--; | |
3861 | } | |
3862 | ||
3855 | 3863 | n = ngx_http_script_variables_count(&tf[i].name); |
3856 | 3864 | |
3857 | 3865 | if (n) { |