Layerline

your sites. your server.

Layerline

a web server, written in zig.

Static files, PHP and apps. Served directly.

Laina waves hello: black and teal twin tails, coral clips, a teal scarf and an off-white utility jacket.
laina / keeping an eye on the routes
HTTP/1.1native
HTTP/2native
HTTP/3experimental

01 / configuration

one file per site.

Keep the listener settings in one place. Give each domain its own config. Static site, PHP app or proxy: same server.

server.conf

host = 127.0.0.1
port = 8080
domain_config_dir = domains-enabled
admin_ui = false
configuration reference
domains-enabled/example.conf

static site

server_name = example.com www.example.com
root = /srv/www/example
index = index.html
serve_static_root = true

Files, ranges, ETags and precompressed sidecars.

reverse proxy

server_name = api.example.com
serve_static_root = false
proxy = http://127.0.0.1:3000, http://127.0.0.1:3001
upstream_policy = least_connections
proxy_timeout_ms = 15000

An HTTP upstream pool with health and retry controls.

php / fastcgi

server_name = app.example.com
root = /srv/www/app/public
serve_static_root = true
php_root = /srv/www/app/public
php_fastcgi = unix:/run/php/php-fpm.sock
php_index = index.php
php_front_controller = true

Use your PHP-FPM socket path. PHP runs separately.

02 / in the server

the useful bits,
already in the tree.

01

files and caching

Byte ranges, ETags, gzip, precompressed files and scoped cache policies.

02

apps and upstreams

HTTP proxy pools, health checks, bounded attempts and direct FastCGI for PHP-FPM.

03

native TLS

TLS 1.3, ALPN and per-domain SNI certificates. Certificate automation integrates with certbot.

04

configs that stay yours

Per-domain files, route overrides, config validation and compatible in-memory reloads.

05

logs and visibility

Structured access logs, metrics, route inspection and upstream diagnostics.

06

an optional control panel

Site management, staged config edits and runtime controls. Off by default; first setup needs a local token.

admin setup and security

03 / where it fits

same job.
different starting point.

Caddy and nginx have years of production use behind them. Layerline is younger. Here's the comparison without pretending otherwise.

Selected capabilities, not performance benchmarks or a claim of feature parity.
capabilityLayerlineCaddynginx
written inZigGoC
HTTP/1.1 + HTTP/2native implementationsincludedHTTP/2 module
HTTP/3experimentalincludedoptional, experimental module
HTTPSnative TLS 1.3; certbot integrationautomatic HTTPSconfigured TLS certificates
PHP-FPMdirect FastCGIphp_fastcgi directiveFastCGI module
managementoptional web UI + local socketadmin APIconfig files + CLI

Selected open-source capabilities. Builds and configuration matter. Sources: Caddy, Caddy PHP, nginx docs, nginx HTTP/3.

a note before you deploy

still being built.

I'm building this to run sites without Caddy or nginx in front. It's not a drop-in replacement yet. HTTP/3 interoperability, longer soak tests and more runtime hardening are still on the list.

the actual roadmap security notes

04 / give it a run

build it.
point it at a site.

You'll need Zig 0.16. This starts a local server on port 8080, with the admin UI off.

deployment guide

from source

git clone https://github.com/raya-ac/Layerline.git
cd Layerline
zig build run -- --config examples/local.conf

then open 127.0.0.1:8080