Files
candy/config.example_full.toml
2025-06-18 20:41:01 +08:00

46 lines
925 B
TOML

# Virtual host
[[host]]
ip = "0.0.0.0"
port = 4000
# Connection timeout
timeout = 15
# SSL certificate
# ssl enable
# ssl = true
# Self sign a certificate
# sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout ./html/selfsigned.key -out ./html/selfsigned.crt
certificate = "./html/selfsigned.crt"
certificate_key = "./html/selfsigned.key"
# Add custom headers to response
[host.headers]
X-Powered-By = "candy"
# Routes for virtual host
[[host.route]]
# Route location
location = "/"
# Static file root
# or proxy_pass
# or redirect
root = "./html"
# Only use for root field
index = ["index.html"]
# List directory
auto_index = true
# Custom 500 page
[host.route.error_page]
status = 500
page = "500.html"
# Custom 404 page
[host.route.not_found_page]
status = 404
page = "404.html"
[[host.route]]
location = "/proxy/"
proxy_pass = "http://localhost:3000/"
# Timeout for connect to upstream
proxy_timeout = 10