mirror of
https://github.com/DefectingCat/candy
synced 2025-07-15 16:51:34 +00:00
chore: update default config
add lua script path
This commit is contained in:
@ -1,7 +1,7 @@
|
|||||||
# Virtual host
|
# Virtual host
|
||||||
[[host]]
|
[[host]]
|
||||||
ip = "0.0.0.0"
|
ip = "0.0.0.0"
|
||||||
port = 4000
|
port = 80
|
||||||
# Connection timeout
|
# Connection timeout
|
||||||
timeout = 15
|
timeout = 15
|
||||||
# SSL certificate
|
# SSL certificate
|
||||||
@ -21,7 +21,7 @@ location = "/"
|
|||||||
# Static file root
|
# Static file root
|
||||||
# or proxy_pass
|
# or proxy_pass
|
||||||
# or redirect
|
# or redirect
|
||||||
root = "./html"
|
root = "html"
|
||||||
# Only use for root field
|
# Only use for root field
|
||||||
index = ["index.html"]
|
index = ["index.html"]
|
||||||
# List directory
|
# List directory
|
||||||
@ -36,10 +36,21 @@ status = 404
|
|||||||
page = "404.html"
|
page = "404.html"
|
||||||
|
|
||||||
# Reverse proxy
|
# Reverse proxy
|
||||||
|
[[host]]
|
||||||
|
ip = "0.0.0.0"
|
||||||
|
port = 8080
|
||||||
[[host.route]]
|
[[host.route]]
|
||||||
location = "/proxy/"
|
location = "/"
|
||||||
proxy_pass = "http://localhost:3000/"
|
proxy_pass = "http://localhost:3000/"
|
||||||
# Timeout for connect to upstream
|
# Timeout for connect to upstream
|
||||||
proxy_timeout = 10
|
proxy_timeout = 10
|
||||||
# Client request max body size (bytes)
|
# Client request max body size (bytes)
|
||||||
max_body_size = 2048
|
max_body_size = 2048
|
||||||
|
|
||||||
|
# Lua script
|
||||||
|
[[host]]
|
||||||
|
ip = "0.0.0.0"
|
||||||
|
port = 8081
|
||||||
|
[[host.route]]
|
||||||
|
location = "/"
|
||||||
|
lua_script = "html/index.lua"
|
||||||
|
@ -188,7 +188,6 @@ pub async fn serve(
|
|||||||
|
|
||||||
// forward request body
|
// forward request body
|
||||||
let body = req.into_body();
|
let body = req.into_body();
|
||||||
// TODO: set body size limit
|
|
||||||
let bytes = axum::body::to_bytes(body, 2048).await.map_err(|err| {
|
let bytes = axum::body::to_bytes(body, 2048).await.map_err(|err| {
|
||||||
tracing::error!("Failed to proxy request: {}", err);
|
tracing::error!("Failed to proxy request: {}", err);
|
||||||
RouteError::InternalError()
|
RouteError::InternalError()
|
||||||
|
Reference in New Issue
Block a user