diff --git a/Server/HttpSession.cpp b/Server/HttpSession.cpp index 6b8f134..c6c4c53 100644 --- a/Server/HttpSession.cpp +++ b/Server/HttpSession.cpp @@ -1,6 +1,7 @@ #include "HttpSession.h" #include "Application.h" #include +#include #include #include #include @@ -72,7 +73,12 @@ void HttpSession::onRead(boost::beast::error_code ec, std::size_t) { boost::urls::matches matches; auto handler = application->find(*path, matches); if (handler) { - (*handler)(*this, request, matches); + try { + (*handler)(*this, request, matches); + } catch (const std::exception &e) { + boost::stacktrace::stacktrace trace = boost::stacktrace::stacktrace::from_current_exception(); + LOG(error) << e.what() << ", trace:\n" << trace; + } } else { std::ostringstream oss; oss << "The resource '" << request.target() << "' was not found."; diff --git a/Server/conf/nginx.conf b/Server/conf/nginx.conf index 029cf09..8f5617e 100644 --- a/Server/conf/nginx.conf +++ b/Server/conf/nginx.conf @@ -65,7 +65,8 @@ http { server_name unraid.amass.fun; client_header_timeout 120s; - client_body_timeout 120s; + client_body_timeout 120s; + client_max_body_size 512m; #上传文件最大支持512m ssl_certificate cert/unraid.amass.fun.pem; ssl_certificate_key cert/unraid.amass.fun.key;