🚀 Ultra-Fast PHP Server with Modern Features
Konfigurasi Caddy + FrankenPHP production-ready untuk Laravel dengan performa maksimal, auto-SSL, dan deployment yang mudah.
FrankenPHP adalah web server modern yang menggabungkan:
| Feature | Traditional PHP-FPM | FrankenPHP |
|---|---|---|
| Startup Time | ❌ Slow (process spawn) | ✅ Fast (persistent) |
| Memory Usage | ❌ High (multiple processes) | ✅ Low (shared memory) |
| SSL Setup | ❌ Manual config | ✅ Auto Let's Encrypt |
| HTTP/2 & HTTP/3 | ⚠️ Complex setup | ✅ Built-in support |
| Real-time Features | ❌ Limited | ✅ WebSockets, SSE |
# Basic Laravel configuration
example.com {
root * /var/www/laravel/public
# FrankenPHP directive
php_server
# Laravel routing
try_files {path} {path}/ /index.php?{query}
# Security headers
header {
X-Frame-Options "SAMEORIGIN"
X-Content-Type-Options "nosniff"
X-XSS-Protection "1; mode=block"
Referrer-Policy "strict-origin-when-cross-origin"
}
}
# Site block - domain configuration
example.com {
# Document root (Laravel public folder)
root * /var/www/laravel/public
# Enable FrankenPHP
php_server
# Handle Laravel routes
try_files {path} {path}/ /index.php?{query}
}
Key Directives:
| Directive | Fungsi |
|---|---|
root * |
📁 Set document root untuk semua paths |
php_server |
⚡ Enable FrankenPHP worker mode |
try_files |
🔄 Laravel routing fallback |