A local HTTPS reverse proxy for development, built on Nginx and Podman. It terminates TLS with mkcert-generated certificates and forwards requests to services running on your host by hostname.
- π HTTPS with local certificates - Uses mkcert for trusted local development
- π Simple YAML configuration - Easy-to-read hostname and location mapping
- π§Ή Automatic cleanup - Remove old entries that are no longer in config
- π Dry-run mode - Preview changes before applying them
- π Certificate management - Generate and inspect certificates easily
- π³ Podman-based - Consistent environment across different systems
- Container runtime: Either Podman (tested) or Docker (untested)
- Compose tool: Podman Compose or Docker Compose
- mkcert for local certificate generation
- OpenSSL for certificate inspection
git clone Berufsnavigator-de/dev-proxy
cd dev-proxy./scripts/init-arch.shFor other systems:
- Ubuntu/Debian:
sudo apt install mkcert && mkcert -install - macOS:
brew install mkcert && mkcert -install - Fedora/RHEL:
sudo dnf install mkcert && mkcert -install
Create hostnames.conf with your local hostnames and proxy mappings:
app.local:
/: http://host.containers.internal:3000
/api: http://host.containers.internal:4000
admin.local:
/: http://host.containers.internal:3100
api.local:
/: http://host.containers.internal:8000
/docs: http://host.containers.internal:8001./scripts/certificates.sh hostnames.conf./scripts/hostnames.sh hostnames.confpodman compose up -dYour services are now available at:
https://app.local:8443https://admin.local:8443https://api.local:8443
The hostnames.conf file uses a simple YAML format:
hostname.local:
/: http://backend:port
/api: http://api-backend:port
/admin: http://admin-backend:port- Top-level keys are the hostnames (e.g.,
app.local) - Indented entries map URL paths to backend services
- Backend URLs should not contain spaces (use %20 encoding if needed)
Manages /etc/hosts entries for your local hostnames.
# Add new hostnames
./scripts/hostnames.sh hostnames.conf
# Clean old entries and add new ones
./scripts/hostnames.sh -c hostnames.conf
# Preview changes without applying
./scripts/hostnames.sh -d hostnames.conf
# Apply changes without confirmation
./scripts/hostnames.sh -y hostnames.conf
# Show help
./scripts/hostnames.sh -hOptions:
-c, --clean- Remove old dev-proxy entries not in current config-d, --dry-run- Show what would change without applying-y, --yes- Automatically answer "yes" to confirmations-h, --help- Show help information
Generates and manages SSL certificates for your hostnames.
# Generate new certificates
./scripts/certificates.sh hostnames.conf
# List current certificates
./scripts/certificates.sh -l
# Show help
./scripts/certificates.sh -hOptions:
-l, --list- Display current certificate information-h, --help- Show help information
Arch Linux-specific script to install and configure mkcert.
The proxy runs in a container with:
- Port:
8443(HTTPS) - Certificates: Mounted from
./certs/ - Configuration: Generated from
hostnames.conf
- Base:
nginx:alpine - Config generation: Automatic on startup
- Template processing: Uses
envsubstfor dynamic configuration - Proxy headers: Standard headers + WebSocket support
Note: This project is tested and optimized for Podman.
# Check certificate status
./scripts/certificates.sh -l
# Regenerate certificates
./scripts/certificates.sh hostnames.conf# Check current entries
./scripts/hostnames.sh -d hostnames.conf
# Clean and reapply
./scripts/hostnames.sh -c hostnames.conf# View generated configs
podman compose exec dev-proxy cat /etc/nginx/conf.d/app.local.confdev-proxy/
βββ certs/ # SSL certificates
βββ compose.yaml # Docker Compose configuration
βββ Dockerfile # Nginx container definition
βββ hostnames.conf # Hostname configuration (create this)
βββ proxy/ # Nginx configuration files
β βββ create_config.sh # Config generator
β βββ hostname.conf.template # Nginx server template
β βββ proxy_headers.conf # Standard proxy headers
βββ scripts/ # Utility scripts
β βββ certificates.sh # Certificate management
β βββ hostnames.sh # Hosts file management
β βββ init-arch.sh # Arch Linux setup
βββ README.md # This file
- Scripts: Keep them POSIX-compliant for portability
- Configuration: Use simple, readable formats (YAML)
- Error handling: Provide clear error messages and help
- Documentation: Update this README for any changes