chore: update default config

add lua script path
This commit is contained in:
xfy
2025-06-26 21:53:24 +08:00
parent 64a85dd5a4
commit 46c2f90f92
2 changed files with 14 additions and 4 deletions

View File

@ -1,7 +1,7 @@
# Virtual host
[[host]]
ip = "0.0.0.0"
port = 4000
port = 80
# Connection timeout
timeout = 15
# SSL certificate
@ -21,7 +21,7 @@ location = "/"
# Static file root
# or proxy_pass
# or redirect
root = "./html"
root = "html"
# Only use for root field
index = ["index.html"]
# List directory
@ -36,10 +36,21 @@ status = 404
page = "404.html"
# Reverse proxy
[[host]]
ip = "0.0.0.0"
port = 8080
[[host.route]]
location = "/proxy/"
location = "/"
proxy_pass = "http://localhost:3000/"
# Timeout for connect to upstream
proxy_timeout = 10
# Client request max body size (bytes)
max_body_size = 2048
# Lua script
[[host]]
ip = "0.0.0.0"
port = 8081
[[host.route]]
location = "/"
lua_script = "html/index.lua"

View File

@ -188,7 +188,6 @@ pub async fn serve(
// forward request body
let body = req.into_body();
// TODO: set body size limit
let bytes = axum::body::to_bytes(body, 2048).await.map_err(|err| {
tracing::error!("Failed to proxy request: {}", err);
RouteError::InternalError()