Description
Static Web Server is a cross-platform, high-performance, asynchronous web server for serving static files. It is written in Rust, ships as a single binary of about 4 MB with no runtime dependencies, and runs on any distribution or in a Docker container. It is configured with command-line flags, environment variables or a TOML file. Its features include HTTP/2 and TLS with HTTPS redirects, on-demand gzip, brotli and zstd compression, and serving pre-compressed .gz, .br and .zst files straight from disk. You can tune Cache-Control and ETag headers, configure CORS with preflight, protect a directory with Basic Auth, and set security headers. For single-page apps, it can serve index.html on 404 for React, Vue and Svelte. Glob-based rewrites and redirects support clean URLs, and a health endpoint and Prometheus metrics are built in. It also supports virtual hosts. The project is dual-licensed under MIT and Apache-2.0, and its source is on GitHub.…
Highlights
- Single ~4 MB Rust binary with no dependencies
- HTTP/2, TLS and smart compression
- SPA fallback, rewrites and redirects
- Basic Auth, security headers and CORS
- Health endpoint and Prometheus metrics
Ratings & Reviews
No ratings yet
Be the first to rate Static Web Server.
People also visit
Ferron
Fast, memory-safe web server written in Rust. (Source Code) MIT Rust/Docker/deb
Static Web Server FAQ
What is Static Web Server?
A fast, open-source web server for serving static websites and web assets, built in Rust.
How do I run it?
As a single binary on Linux, macOS or Windows, or in a Docker container. The site's example runs it with --port and --root flags.
How do I configure it?
With CLI flags, environment variables or a TOML file.
Does it support single-page apps?
Yes. It can serve index.html for 404 responses, which suits React, Vue and Svelte apps.
Can it compress files?
Yes. It supports on-demand gzip, brotli and zstd, and it can serve pre-compressed files.
What license is it under?
MIT or Apache-2.0, at your option, according to the repository's license files.
What are the best Static Web Server alternatives?
Popular alternatives to Static Web Server include Local Web Server, Caddy and Static.app. See all Static Web Server alternatives

