Skip to main content

ROCKET_CONFIG

Constant ROCKET_CONFIG 

Source
pub const ROCKET_CONFIG: &str = r#"
[default]
# Network settings
address = "0.0.0.0"               # Listen on all network interfaces
port = 8000                       # Port number
workers = 16                      # Number of threads for request handling (adjust to number of CPU cores)
keep_alive = 5                    # Keep-alive timeout in seconds
max_blocking = 512                # Maximum number of blocking operations allowed simultaneously
temp_dir = "/tmp"                 # Directory for temporary files
ident = "Rocket"                  # Server identifier in responses

# Logging and debugging
log_level = "normal"            # Logging level: "critical", "normal", "debug"
cli_colors = true                 # Enable CLI colors for local logs

# Security
ip_header = "X-Real-IP"           # Use reverse proxy header for client IP detection (set to "false" if unused)

# Resource limits
[default.limits]
json = 52428800                 # Max size for JSON payloads (10 MB)
form = 2097152                    # Max size for form submissions (2 MB)
file = 52428800                   # Max size for uploaded files (50 MB)

# TLS configuration (uncomment and configure for HTTPS)
[default.tls]
certs = "/certs/client_cert.pem" # Path to TLS certificate
key = "/certs/client_key.pem"    # Path to private key

[global]
# Global overrides for all environments
address = "0.0.0.0"
port = 8000

[global.limits]
json = 52428800
form = 2097152
file = 52428800
"#;