Oracle Cloud Infrastructure (OCI) has emerged as a strong contender for enterprise workloads in India, offering competitive pricing, high-performance bare metal compute, and a mature networking stack. In this guide we walk through building a production-ready OCI environment with a Load Balancer and Web Application Firewall (WAF) — two components that are non-negotiable for any internet-facing application.
OCI Architecture Overview
A well-architected OCI deployment for a web application typically looks like this:
- VCN (Virtual Cloud Network) with public and private subnets across two Availability Domains
- Internet Gateway for public subnet egress, NAT Gateway for private subnet egress
- OCI Load Balancer in the public subnet, distributing traffic to backend compute instances
- OCI WAF sitting in front of the Load Balancer, filtering malicious traffic at the edge
- Compute instances (VMs or bare metal) in the private subnet running your application
- OCI Vault for secrets management and OCI Bastion for secure SSH access
Setting Up the OCI Load Balancer
OCI offers two load balancer types — the classic Load Balancer (Layer 7, HTTP/HTTPS) and the Network Load Balancer (Layer 4, TCP/UDP). For web applications, use the Layer 7 Load Balancer.
- Create a Load Balancer in the public subnet with a flexible shape (10 Mbps to 8 Gbps)
- Define a Backend Set with your compute instances and a health check path (e.g. /health)
- Configure an HTTPS Listener on port 443 with your SSL certificate from OCI Certificates
- Add an HTTP Listener on port 80 with a redirect rule to HTTPS
- Enable session persistence if your application requires sticky sessions
- Set connection idle timeout to 300 seconds for long-running API calls
Need help implementing this?
Our certified engineers can assess your environment and build the right solution — free initial assessment, fixed-quote pricing.
Configuring OCI WAF
OCI WAF operates as a cloud-based reverse proxy, inspecting HTTP/HTTPS traffic before it reaches your Load Balancer. It protects against OWASP Top 10 threats, DDoS, and bot traffic.
- Create a WAF Policy and point it to your Load Balancer's public IP or hostname
- Enable the OWASP Core Rule Set — start in Detection mode, review logs, then switch to Prevention
- Configure rate limiting rules — e.g. 1000 requests per minute per IP for API endpoints
- Add IP allowlists for your office and VPN IPs to avoid false positives on admin paths
- Enable Bot Management to block known malicious bots while allowing Googlebot and Bingbot
- Set up WAF logs to OCI Logging for SIEM integration and compliance reporting
Security Hardening Checklist
Beyond the Load Balancer and WAF, these hardening steps are essential for a production OCI deployment:
- Security Lists and NSGs — restrict inbound traffic to only required ports; backend instances should accept traffic only from the Load Balancer subnet
- OCI Vault — store database passwords, API keys, and certificates; never hardcode secrets in compute instances
- OCI Bastion — replace direct SSH access with session-based Bastion access; no public IPs on compute instances
- OS hardening — disable root SSH login, enforce key-based authentication, enable auditd
- OCI Cloud Guard — enable for continuous security posture monitoring and misconfiguration detection
- Backup policy — attach a backup policy to all boot and block volumes with daily snapshots retained for 30 days
Cost Optimisation Tips
OCI's pricing is significantly lower than AWS and Azure for equivalent compute, but there are still ways to optimise:
- Use Always Free tier resources for dev/test — 2 AMD VMs, 200 GB block storage, and Load Balancer are permanently free
- Commit to 1-year or 3-year Universal Credits for 33–50% savings on production workloads
- Use Preemptible Instances for batch processing and non-critical workloads at 50% discount
- Right-size instances using OCI Compute Autoscaling based on CPU and memory metrics
Free tools for this topic
Check your own setup in under a minute
Need Help Implementing This?
Our certified engineers can assess your environment and implement the right solution for your business.
Related Services