💡 Tip: Variables prefixed with CN_ are reserved for CloudNexus platform configuration. Do not override them unless explicitly documented. Custom variables should use your application's namespace.
⚙️ Core Platform
VariableTypeDefaultDescription
CN_REGIONRequiredStringus-east-1Primary deployment region. Supported values: us-east-1, eu-west-1, ap-south-1, sa-east-1.
CN_ENVOptionalStringproductionApplication environment stage. Affects logging verbosity, cache TTL, and deployment routing.
CN_REPLICASOptionalInteger2Minimum number of running instances. Auto-scaling will never scale below this value.
CN_HEALTH_CHECK_PATHOptionalString/healthHTTP endpoint used by the load balancer to verify instance readiness. Must return HTTP 200.
🗄️ Database & Storage
VariableTypeDefaultDescription
CN_DB_HOSTRequiredStringnullHostname of the managed PostgreSQL/MySQL instance. Auto-injected when using CloudNexus Managed Databases.
CN_DB_PORTOptionalInteger5432Database connection port. Use 6379 for Redis, 27017 for MongoDB.
CN_DB_POOL_SIZEOptionalInteger20Maximum concurrent connections per instance. Should not exceed 80% of your database plan's connection limit.
🌐 CDN & Network
VariableTypeDefaultDescription
CN_CDN_TTLOptionalInteger3600Cache time-to-live in seconds for static assets at edge locations. Set to 0 to disable caching.
CN_PROTOCOLOptionalStringhttpsEnforce traffic protocol. Values: http, https, auto (recommended).
🔒 Security & Compliance
VariableTypeDefaultDescription
CN_SSL_MODEOptionalStringforceSSL/TLS termination behavior. force redirects HTTP→HTTPS, permissive allows both, disable (not recommended).
CN_WAF_RULESOptionalStringstandardWeb Application Firewall preset. Options: strict, standard, paranoid, or custom rule ID.
💳 Billing & Usage
VariableTypeDefaultDescription
CN_BILLING_ALERTOptionalFloat100.0Monthly spend threshold in USD. Triggers email/webhook alerts when projected usage exceeds this amount.
CN_METRICS_RETENTIONOptionalString30dHow long to retain detailed usage metrics. Formats: 7d, 30d, 90d, 1y.
Usage Examples
.env / Deployment Config
# Core Configuration CN_REGION=eu-west-1 CN_ENV=staging CN_REPLICAS=3 # Database Pooling CN_DB_POOL_SIZE=40 CN_DB_HOST=db-prod-82a.cloudnexus.net # CDN & Security CN_CDN_TTL=7200 CN_SSL_MODE=force CN_WAF_RULES=strict
cloudnexus deploy (CLI)
# Override variables inline during deployment cloudnexus deploy \ --env CN_REGION=ap-south-1 \ --env CN_REPLICAS=5 \ --env CN_WAF_RULES=paranoid # Load from .env file cloudnexus deploy --env-file .env.production
⚠️ Important: Changes to environment variables require a deployment restart to take effect. Use the CLI or dashboard cn restart --graceful to avoid service interruption. Sensitive values (passwords, API keys) should be stored using CloudNexus Secrets Manager, not plain environment variables.