HTTP & static files
| Field | Type / default | Behavior |
|---|---|---|
| http.binds | Object; {} | Maps each exact hostname to a numeric TCP port. Multiple hostnames can use one port. |
| http.max_body_size | Unsigned integer; 1048576 | Maximum forwarded request body size in bytes (1 MiB by default). For gzip requests, the limit applies after decompression. Requests exceeding the enforced limit return HTTP 413. |
| http.static_dir | String or null; null | Directory of files served before requests reach an application. Use a path relative to the source root, such as ./public. Omit it or use null to disable static-file serving. |
Bind your application to the configured port, for example 0.0.0.0:3000. Leilani terminates public HTTPS and forwards HTTP to that listener. A binding does not set the application’s listening address, select a package, or set a PORT environment variable.
Leilani forwards the public request details in X-Forwarded-Proto (https), X-Forwarded-Host, X-Forwarded-Port, and X-Forwarded-For (the connecting client’s IP). Incoming forwarded headers are replaced. Configure your framework’s trusted-proxy handling when generating absolute URLs or secure cookies.
X-Leilani-Request-ID identifies the request in proxy logs. When location data is available, the proxy also supplies X-Leilani-City, X-Leilani-Country, X-Leilani-Time-Zone, X-Leilani-Latitude, and X-Leilani-Longitude. These location headers are optional.
Packages in the same VM can communicate over loopback. Outbound networking supports public IPv4 TCP and UDP destinations; private, loopback, link-local, and host-network destinations are blocked at the VM’s external network boundary. Use a publicly reachable endpoint for an external database, or the managed PostgreSQL Unix socket.
Deployment waits up to 60 seconds for all configured packages to start. This includes private packages without HTTP bindings. Leilani does not check HTTP responses or whether application initialization has finished.
Hostnames contain no scheme, port, or path. Use app.example.com, not a URL. Names are case-insensitive and trailing dots are normalized. IP addresses and wildcard hostnames are not supported.
With static_dir: "./public", a request for /styles.css serves public/styles.css if that file exists. Missing files and directory paths fall through to the application: there is no automatic index.html or single-page application fallback. Access rules run before static-file serving. Include the intended public files in your pushed source, and keep secrets outside this directory.