A simple, fast, and configurable TCP/IP reverse proxy written in Rust with automatic SSL certificate management via Let's Encrypt.
- 🚀 High Performance: Built with Rust and Tokio for excellent performance and memory safety
- 🔒 Automatic SSL (HTTPS): Integrated Let's Encrypt support with automatic certificate provisioning and renewal via ACME (TLS-ALPN-01)
- 🌐 Multi-Domain: Serve multiple domains with individual certificates (no wildcard certs)
- 🔁 Smart Redirects: Optional per-route HTTP→HTTPS redirects that only occur when TLS is actually available for that host
- 🧩 Config Hot-Reload: JSON-based configuration with live updates and graceful restarts of the HTTPS server when needed
- 🧰 SSL Toggle: Global config flag to enable/disable the HTTPS server without changing routes
- 📊 Logging: Configurable logging levels for monitoring and debugging
Download the latest release from the releases page or build from source:
git clone <repository-url>
cd minipx
cargo build --releaseInstall using the provided script:
sudo bash -c "$(curl -sSL https://raw.githubusercontent.com/Drew-Chase/minipx/master/install.sh)" < /dev/ttysudo curl -sSL https://raw.githubusercontent.com/Drew-Chase/minipx/master/install.sh | bash -s -- --uninstall- Create a configuration file (see Configuration below), then run:
minipx --config ./minipx.json- Run with configuration watching enabled (hot-reload):
minipx --watch --verbose --config ./config/config.jsonNote: The configuration directory will be created automatically if it doesn't exist.
- HTTP server listens on the configured port (default 80) on 0.0.0.0.
- HTTPS server listens on port 443 on [::] (all IPv6/IPv4 via dual-stack), automatically handling ACME TLS-ALPN-01 challenges and serving TLS.
- When a route has redirect_to_https = true, HTTP requests are redirected to HTTPS only if a certificate can be served for that host; otherwise, the request is served over HTTP and a warning is logged.
| Short | Long | Description | Default |
|---|---|---|---|
-h |
--help |
Show help information | - |
-V |
--version |
Display version information | - |
-c |
--config |
Path to the configuration file | ./minipx.json |
-v |
--verbose |
Enable verbose logging output | false |
-w |
--watch |
Watch configuration file for changes | false |
# Basic usage with default config
minipx
# Use custom config with verbose logging
minipx --verbose --config /etc/minipx/config.json
# Enable hot-reload with configuration watching
minipx --watch --verbose --config ./config/config.json
# You can also concat the short options together
minipx -wvc /etc/minipx/config.jsonMinipx uses a JSON configuration file to define proxy behavior, SSL settings, and routing rules.
| Field | Type | Description | Default |
|---|---|---|---|
email |
string | Email for Let's Encrypt account (required for HTTPS) | email@example.com |
port |
number | Port for the HTTP reverse proxy to listen on | 80 |
cache_dir |
string | Directory for ACME account/certificate cache | ./cache |
ssl_enabled |
boolean | Enable or disable the HTTPS server globally | true |
routes |
object | Domain-to-route mapping configuration | {} |
Each entry under routes maps a domain (e.g., "api.example.com") to proxy settings.
| Field | Type | Description | Default |
|---|---|---|---|
host |
string | Target hostname to proxy requests to | localhost |
path |
string | Base path for proxied requests (no trailing /) | "" |
port |
number | Target port for the backend service | 8080 |
protocol |
string | Backend protocol (http or https) |
http |
redirect_to_https |
boolean | Force HTTPS redirect for HTTP requests | false |
Notes:
- Wildcard route keys (like "*.example.com") are supported for routing lookups, but wildcard certificates are NOT requested. Only exact domains are used for ACME.
{
"email": "admin@mydomain.com",
"port": 80,
"cache_dir": "./ssl-cache",
"ssl_enabled": true,
"routes": {
"api.mydomain.com": {
"host": "localhost",
"path": "/api/v1",
"port": 3000,
"protocol": "http",
"redirect_to_https": true
},
"app.mydomain.com": {
"host": "192.168.1.100",
"port": 8080,
"protocol": "http",
"redirect_to_https": true
},
"secure.mydomain.com": {
"host": "backend-server",
"port": 443,
"protocol": "https",
"redirect_to_https": false
}
}
}Minipx uses rustls-acme with the Let's Encrypt production directory.
- Validation: TLS-ALPN-01 (served on port 443). No HTTP-01 is used.
- Certificate caching: Stored in
cache_dirto avoid rate limits. - Multi-domain: Certificates are requested for all valid, exact domains present as keys in
routes. - Wildcards: Not supported for certificates. Wildcard route keys are ignored for ACME.
Requirements:
- Domains must resolve to this server.
- Port 443 must be publicly accessible for TLS-ALPN-01 validation and HTTPS traffic.
- A valid email must be provided for the ACME account. If the email is invalid, the HTTPS server won’t start and will wait for a valid config.
Behavior with invalid config:
- If
ssl_enabledis false: HTTPS server does not start (waits for enablement via hot-reload). - If
emailis invalid: HTTPS server waits until a valid email is provided. - If some domains are invalid: HTTPS starts for valid domains only and logs the skipped ones.
- HTTP→HTTPS redirects occur only when a certificate can be served for that host; otherwise traffic is served over HTTP and a warning is logged.
Hot-reload behavior:
- Changes to
ssl_enabled,email,cache_dir, or the set of valid domains trigger a graceful HTTPS server restart.
Minipx uses structured logging with different levels:
- Error: Critical errors and failures
- Warn: Warning messages and recoverable errors
- Info: General information about proxy operations
- Debug/Trace: More detailed logs (enabled with
--verbose)
Set the RUST_LOG environment variable for custom log levels:
RUST_LOG=debug minipx --config config.jsonCommon issues:
- Binding to privileged ports (80/443)
- On Linux/macOS, run with sudo or use capabilities (e.g., setcap) to bind <1024.
- Ensure no other service is using the port.
- Certificate acquisition failures
- Verify DNS records resolve to this server.
- Ensure port 443 is reachable from the internet.
- Check that
cache_diris writable and persistent. - Confirm
emailis valid.
- Backend connection refused
- Verify target service is running and reachable from Minipx.
- Check
host,port, andprotocolin your route configuration.
Contributions are welcome! Please feel free to submit issues, feature requests, or pull requests.
This project is licensed under the MIT License — see the LICENSE file for details.
Built with these excellent Rust crates:
- tokio — Async runtime
- hyper — HTTP implementation
- rustls — TLS implementation
- rustls-acme — Let's Encrypt integration
- serde — Serialization framework
- clap — Command line argument parsing