always test root existence for access_log with variables
Igor Sysoev
13 years ago
365 | 365 |
ngx_http_log_loc_conf_t *llcf;
|
366 | 366 |
ngx_http_core_loc_conf_t *clcf;
|
367 | 367 |
|
368 | |
if (r->err_status == NGX_HTTP_NOT_FOUND) {
|
|
368 |
if (!r->root_tested) {
|
369 | 369 |
|
370 | 370 |
/* test root directory existance */
|
371 | 371 |
|
|
386 | 386 |
of.events = clcf->open_file_cache_events;
|
387 | 387 |
|
388 | 388 |
if (ngx_open_cached_file(clcf->open_file_cache, &path, &of, r->pool)
|
389 | |
!= NGX_OK
|
390 | |
|| !of.is_dir)
|
|
389 |
!= NGX_OK)
|
391 | 390 |
{
|
392 | |
/* no root directory: simulate successfull logging */
|
|
391 |
if (of.err == 0) {
|
|
392 |
/* simulate successfull logging */
|
|
393 |
return len;
|
|
394 |
}
|
|
395 |
|
|
396 |
ngx_log_error(NGX_LOG_ERR, r->connection->log, of.err,
|
|
397 |
"testing \"%s\" existence failed", path.data);
|
|
398 |
|
|
399 |
/* simulate successfull logging */
|
|
400 |
return len;
|
|
401 |
}
|
|
402 |
|
|
403 |
if (!of.is_dir) {
|
|
404 |
ngx_log_error(NGX_LOG_ERR, r->connection->log, NGX_ENOTDIR,
|
|
405 |
"testing \"%s\" existence failed", path.data);
|
|
406 |
|
|
407 |
/* simulate successfull logging */
|
393 | 408 |
return len;
|
394 | 409 |
}
|
395 | 410 |
}
|