diff options
Diffstat (limited to 'src/http/modules/ngx_http_static_handler.c')
-rw-r--r-- | src/http/modules/ngx_http_static_handler.c | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/src/http/modules/ngx_http_static_handler.c b/src/http/modules/ngx_http_static_handler.c index ad2669be6..9849dbf34 100644 --- a/src/http/modules/ngx_http_static_handler.c +++ b/src/http/modules/ngx_http_static_handler.c @@ -158,22 +158,6 @@ ngx_log_debug(r->connection->log, "FILE: %d" _ r->file.fd); r->file.info_valid = 1; } -#if !(WIN32) /* the not regular files are probably Unix specific */ - - if (!ngx_is_file(r->file.info)) { - ngx_log_error(NGX_LOG_CRIT, r->connection->log, ngx_errno, - "%s is not a regular file", r->file.name.data); - - if (ngx_close_file(r->file.fd) == NGX_FILE_ERROR) - ngx_log_error(NGX_LOG_ALERT, r->connection->log, ngx_errno, - ngx_close_file_n " %s failed", r->file.name.data); - - return NGX_HTTP_NOT_FOUND; - } - -#endif -#endif - if (ngx_is_dir(r->file.info)) { ngx_log_debug(r->connection->log, "HTTP DIR: '%s'" _ r->file.name.data); @@ -203,6 +187,22 @@ ngx_log_debug(r->connection->log, "HTTP DIR: '%s'" _ r->file.name.data); return NGX_HTTP_MOVED_PERMANENTLY; } +#if !(WIN32) /* the not regular files are probably Unix specific */ + + if (!ngx_is_file(r->file.info)) { + ngx_log_error(NGX_LOG_CRIT, r->connection->log, ngx_errno, + "%s is not a regular file", r->file.name.data); + + if (ngx_close_file(r->file.fd) == NGX_FILE_ERROR) + ngx_log_error(NGX_LOG_ALERT, r->connection->log, ngx_errno, + ngx_close_file_n " %s failed", r->file.name.data); + + return NGX_HTTP_NOT_FOUND; + } + +#endif +#endif + r->content_handler = ngx_http_static_handler; return NGX_OK; |