1.增加unraid反向代理body最大大小。

This commit is contained in:
luocai 2024-05-06 16:54:34 +08:00
parent 3fa2c054e2
commit 5256ab94de
2 changed files with 9 additions and 2 deletions

View File

@ -1,6 +1,7 @@
#include "HttpSession.h" #include "HttpSession.h"
#include "Application.h" #include "Application.h"
#include <boost/config.hpp> #include <boost/config.hpp>
#include <boost/stacktrace.hpp>
#include <boost/url/parse_path.hpp> #include <boost/url/parse_path.hpp>
#include <boost/url/url_view.hpp> #include <boost/url/url_view.hpp>
#include <iostream> #include <iostream>
@ -72,7 +73,12 @@ void HttpSession::onRead(boost::beast::error_code ec, std::size_t) {
boost::urls::matches matches; boost::urls::matches matches;
auto handler = application->find(*path, matches); auto handler = application->find(*path, matches);
if (handler) { if (handler) {
try {
(*handler)(*this, request, matches); (*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 { } else {
std::ostringstream oss; std::ostringstream oss;
oss << "The resource '" << request.target() << "' was not found."; oss << "The resource '" << request.target() << "' was not found.";

View File

@ -66,6 +66,7 @@ http {
client_header_timeout 120s; 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 cert/unraid.amass.fun.pem;
ssl_certificate_key cert/unraid.amass.fun.key; ssl_certificate_key cert/unraid.amass.fun.key;