# Virtual host [[host]] ip = "0.0.0.0" port = 80 # 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" # Reverse proxy [[host]] ip = "0.0.0.0" port = 8080 [[host.route]] 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"