Fixed request finalization in ngx_http_index_handler(). Returning 500 instead of NGX_ERROR is preferable here because header has not yet been sent to the client.