Common Issues
Backend Connection Failed (502 Bad Gateway)
Backend Connection Failed (502 Bad Gateway)
Symptoms
Causes
- Backend service is down or unreachable
- Incorrect backend configuration in
BACKENDSenvironment variable - Network connectivity issues
- Backend hostname cannot be resolved
Solutions
Verify backend configuration:Check yourBACKENDS environment variable:BACKENDS (main.go:548).WAF Blocking Legitimate Requests (False Positives)
WAF Blocking Legitimate Requests (False Positives)
Symptoms
Causes
- Paranoia level too high for your application
- Specific CRS rules too strict for your use case
- Application behavior triggering legitimate security rules
- Missing rule exclusions for your framework
Solutions
Review audit logs:Identify which rules are triggering:- PL1 (Sites): Lower paranoia, fewer false positives
- Path:
/app/coraza.conf:/app/coreruleset/pl1-crs-setup.conf:/app/coreruleset/rules/*.conf - Used for: Hosts in
PROXY_WEB_HOSTS
- Path:
- PL2 (APIs): Higher paranoia, more restrictive
- Path:
/app/coraza.conf:/app/coreruleset/pl2-crs-setup.conf:/app/coreruleset/rules/REQUEST-901-INITIALIZATION.conf:/app/coreruleset/rules/*.conf - Used for: Hosts in
PROXY_APIS_HOSTS
- Path:
profiles/django-exclusions.conf):Rate Limiting Too Aggressive
Rate Limiting Too Aggressive
Symptoms
Causes
- Rate limits set too low for traffic patterns
- Multiple users behind same NAT/proxy IP
- Burst limit insufficient for usage patterns
- Aggressive automated tools or scripts
Solutions
Adjust rate limit settings:Default configuration (main.go:412-415):- Implementing separate limiters per endpoint
- Using a dedicated rate limiting service
- Whitelisting trusted IPs
WAF Not Configured for Host
WAF Not Configured for Host
Symptoms
Causes
The host is not defined in eitherPROXY_WEB_HOSTS or PROXY_APIS_HOSTS (main.go:473).Solutions
Add host to environment variables:example.com not example.com:8081.Check logs:GeoIP Blocking Not Working
GeoIP Blocking Not Working
Symptoms
- No geo-blocking despite configuration
- Error:
geo lookup failed - Fatal error:
GeoIP DB error
Causes
- GeoIP database not loaded or missing
GEO_BLOCK_ENABLEDnot set to true- Database path incorrect
- Invalid IP addresses
Solutions
Enable geo-blocking:/app/GeoLite2-Country.mmdb (main.go:372):- Invalid format
- Private IP range (not in GeoIP database)
- Localhost (127.0.0.1)
Bot Blocking Issues
Bot Blocking Issues
Symptoms
Causes
Bot detection is based on User-Agent string matching (main.go:447-458).Solutions
Customize bot list:Default bots (main.go:449):-
Remove them from
PROXY_BOTS: - Or disable bot blocking entirely and use WAF rules instead
Log Files Not Created
Log Files Not Created
Symptoms
- Missing
/tmp/log/coraza/audit.log - Missing
/tmp/log/coraza/debug.log - Permission errors on log files
Causes
- Insufficient permissions to create
/tmp/log/coraza/ - Filesystem full or read-only
- SELinux or AppArmor restrictions
Solutions
Check directory creation:The proxy creates the directory during startup (main.go:345):High Memory Usage
High Memory Usage
Symptoms
- Increasing memory consumption over time
- Out of memory errors
- Container restarts due to memory limits
Causes
- Large request bodies being buffered
- Rate limiter state accumulation
- WAF transaction memory not freed
- Memory leak in application
Solutions
Monitor rate limiter cleanup:Rate limiters are cleaned every minute (main.go:84-95):coraza.conf:SecDataDir /tmp/).Verify transaction cleanup:Ensure transactions are closed (main.go:480-485):Diagnostic Commands
Check Proxy Status
Analyze Logs
Test WAF Rules
Verify Configuration
Getting Help
If you continue to experience issues:- Enable debug logging: Set
SecDebugLogLevel 3temporarily - Collect logs: Gather application logs, audit logs, and debug logs
- Document the issue: Include request examples, error messages, and configuration
- Check source code: Review relevant sections in main.go for detailed behavior
- Review CRS documentation: Visit OWASP Core Rule Set for rule-specific guidance
