Skip to Content
ConfigurationEnvironment Variables

Environment Variables

rproxy is configured entirely through environment variables. No config files needed.

Server

VariableDefaultDescription
RPROXY_LISTEN0.0.0.0:443Address and port to listen on
RPROXY_HTTP_PORT80Port for HTTP→HTTPS redirect
RPROXY_LOG_LEVELinfoLog level: error, warn, info, debug, trace

Upstream

VariableDefaultDescription
RPROXY_UPSTREAM127.0.0.1:3000Backend server address
RPROXY_UPSTREAM_TIMEOUT30Connection timeout in seconds

TLS

VariableDefaultDescription
RPROXY_TLS_DOMAINS-Domains for Let’s Encrypt (comma-separated)
RPROXY_TLS_EMAIL-Email for Let’s Encrypt notifications
RPROXY_TLS_CACHE_DIR/var/lib/rproxy/certsDirectory for certificate storage

Note: If RPROXY_TLS_DOMAINS is empty, TLS is disabled and the server runs HTTP only.

Rate Limiting

VariableDefaultDescription
RPROXY_RATE_LIMIT_ENABLEDtrueEnable rate limiting
RPROXY_RATE_LIMIT100Requests per second per IP
RPROXY_RATE_BURST200Maximum burst size

Caching

VariableDefaultDescription
RPROXY_CACHE_ENABLEDtrueEnable response caching
RPROXY_CACHE_SIZE500Maximum cache entries
RPROXY_CACHE_PATHS/_next/static/*,*.css,*.jsPaths to cache (comma-separated globs)

Security

VariableDefaultDescription
RPROXY_HSTStrueEnable HSTS header
RPROXY_FILTER_ENABLEDtrueEnable path filtering
RPROXY_BLOCKED_PATHS/.env*,/.git*,/*.sqlBlocked paths (comma-separated globs)

Default Security Headers

When enabled, rproxy adds these headers to all responses:

Strict-Transport-Security: max-age=31536000; includeSubDomains X-Content-Type-Options: nosniff X-Frame-Options: DENY X-XSS-Protection: 1; mode=block Referrer-Policy: strict-origin-when-cross-origin

WebSocket

VariableDefaultDescription
RPROXY_WS_ENABLEDtrueEnable WebSocket passthrough
RPROXY_WS_PATHS/_next/webpack-hmr,/ws/*,/socket.io/*WebSocket paths (comma-separated)

Example Configurations

Next.js Production

RPROXY_UPSTREAM=nextjs:3000 RPROXY_TLS_DOMAINS=myapp.com,www.myapp.com RPROXY_TLS_EMAIL=admin@myapp.com RPROXY_RATE_LIMIT=100 RPROXY_HSTS=true RPROXY_CACHE_ENABLED=true

Local Development

RPROXY_UPSTREAM=127.0.0.1:3000 RPROXY_TLS_DOMAINS="" RPROXY_LISTEN=0.0.0.0:8080 RPROXY_LOG_LEVEL=debug

High-Traffic API

RPROXY_UPSTREAM=api:8000 RPROXY_TLS_DOMAINS=api.myapp.com RPROXY_RATE_LIMIT=500 RPROXY_RATE_BURST=1000 RPROXY_CACHE_ENABLED=false RPROXY_WS_ENABLED=false
Last updated on