plyserve is a production-grade Rust web server focused on ultra-high-performance WordPress workloads (static files, PHP-FPM, reverse proxy, caching) with safe runtime reloads.
Caution
This is fully vibe coded, we do not support this shit. Use on your own risk.
cargo build --release
sudo install -m 0755 target/release/plyserve /usr/local/bin/plyserveGlobal config path (default): /etc/plyserve/plyserve.toml
Example plyserve.toml:
listeners = [
{ addr = "0.0.0.0:80", tls = false },
{ addr = "0.0.0.0:443", tls = true },
]
sites_dir = "/etc/plyserve/sites"
control_socket = "/run/plyserve/control.sock"
# Optional default TLS cert (fallback when no per-site cert matches).
[tls]
enabled = true
http2 = true
redirect_http = false
cert = "/etc/plyserve/certs/default/fullchain.pem"
key = "/etc/plyserve/certs/default/privkey.pem"Start server:
plyserve/etc/plyserve/sites/example.com.toml:
server_names = ["example.com", "www.example.com"]
root = "/var/www/example/public"
listen = [80, 443]
index = ["index.php", "index.html"]
php_fpm = "unix:/run/php/php8.3-fpm-example.sock"
uploads_php = false
[static_cache]
enabled = true
[tls]
enabled = true
cert = "/etc/plyserve/certs/example/fullchain.pem"
key = "/etc/plyserve/certs/example/privkey.pem"
[[proxy]]
path_prefix = "/api"
upstreams = ["http://127.0.0.1:9001"]
websocket = true- Put WordPress in
root. - Ensure
php_fpmpoints to the correct pool socket. - plyserve serves static files directly, then falls back to
/index.php. - PHP execution in
wp-content/uploadsis disabled by default.
Prefer Unix sockets for lower overhead. Example pool config:
listen = /run/php/php8.3-fpm-example.sock
listen.owner = www-data
listen.group = www-data
plyserve uses rustls with SNI selection from per-site TLS configs. Certs are loaded from disk. You can point cert/key at certbot or acme.sh output. Reloads are safe via control socket.
Unix socket: /run/plyserve/control.sock
Commands (JSON per line):
reload_all_sitesreload_site { server_name }add_site { site_config }update_site { site_config }remove_site { server_name }purge_cache { host, path_prefix }stats
CLI helper:
plyserve ctl reload-all
plyserve ctl reload-site example.com
plyserve ctl add-site /etc/plyserve/sites/example.com.toml
plyserve ctl update-site /etc/plyserve/sites/example.com.toml
plyserve ctl remove-site example.com
plyserve ctl purge-cache example.com /
plyserve ctl stats- Use
wrkorwrk2for HTTP/1.1 andh2loadfor HTTP/2. - Test with and without PHP to validate FastCGI path.
- Validate cache hit rates with repeated GET/HEAD requests.
Example:
wrk -t8 -c256 -d30s http://127.0.0.1:8080/- Listening sockets never close during reloads.
- Site configs persist to disk; hard restarts reload from
/etc/plyserve/sites. - Observability:
statscommand returns counters and latency samples.