Exercise 1: SSL/TLS Configuration
- Generate a self-signed SSL certificate
- Configure NGINX to serve HTTPS on port 443
- Set up HTTP to HTTPS redirect
- Configure strong SSL settings (TLS 1.2+, strong ciphers)
- Test SSL configuration with browser and command line tools
Exercise 2: Let's Encrypt Setup
- Install Certbot
- Set up a basic HTTP server block
- Obtain Let's Encrypt certificate using Certbot
- Verify auto-renewal is configured
- Test certificate renewal (dry run)
Exercise 3: Reverse Proxy
- Set up a simple backend application (Node.js, Python, etc.)
- Configure NGINX as reverse proxy to backend
- Set proper proxy headers (X-Real-IP, X-Forwarded-For, etc.)
- Test proxying functionality
- Configure WebSocket support
Exercise 4: Load Balancing
- Set up 2-3 backend servers (can be on same machine, different ports)
- Create an upstream block with all backend servers
- Configure round-robin load balancing
- Test that requests are distributed across servers
- Configure weighted load balancing
- Test failover by stopping one backend server
Exercise 5: URL Rewriting
- Set up HTTP to HTTPS redirect
- Configure www to non-www redirect (or vice versa)
- Create clean URLs (remove .php extension)
- Set up RESTful URL routing
- Test all redirects and rewrites
Exercise 6: Caching
- Set up proxy cache zone
- Configure caching for backend responses
- Set different cache times for different status codes
- Test cache hits and misses
- Configure browser caching for static files
- Monitor cache effectiveness
Exercise 7: Virtual Hosting
- Set up 3 different websites with different domains
- Configure name-based virtual hosting
- Set up subdomains (www, blog, api)
- Configure wildcard subdomain handling
- Test all domains and subdomains
Exercise 8: Advanced Caching
- Set up separate cache zones for different content types
- Configure cache purging mechanism
- Implement stale-while-revalidate
- Set up cache warming script
- Monitor cache hit ratio