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 "Application.h"
#include <boost/config.hpp>
#include <boost/stacktrace.hpp>
#include <boost/url/parse_path.hpp>
#include <boost/url/url_view.hpp>
#include <iostream>
@ -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.";

View File

@ -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;