WordPress
Gyakorlati PHP-FPM recept egy normál WordPress front controllerhez.
WordPress vhost
[[vhosts]]
name = "wordpress"
hosts = ["blog.example.com"]
[vhosts.web]
root = "/srv/wordpress"
index_files = ["index.php", "index.html"]
deny_dotfiles = true
[vhosts.php]
enabled = true
root = "/srv/wordpress"
index = "index.php"
preset = "wordpress"
try_files = "wordpress"
deny_path_prefixes = ["/wp-content/uploads/"]
[vhosts.php.fpm]
mode = "external"
socket = "/run/php-fpm/wordpress.sock"
WordPress cache route
[[vhosts.routes]]
name = "wp-assets"
path_prefix = "/wp-content/"
action = "proxy"
[vhosts.routes.proxy]
upstreams = ["127.0.0.1:9000"]
[vhosts.routes.cache]
enabled = true
preset = "wordpress"
status_ttls = { "200" = 3600, "404" = 60 }
extensions = ["css", "js", "png", "jpg", "webp", "svg"]
bypass_cookie_name_prefixes = ["wordpress_logged_in_", "wordpress_sec_"]
Gyakori ellenőrzések
- Győződj meg róla, hogy a PHP-FPM user olvasni tudja a WordPress fájlokat.
- Az uploads csak ott legyen writable, ahol a WordPressnek írásra van szüksége.
- Put cache in front of public assets, not wp-admin.
- Keep login, preview, cron, XML-RPC, and admin paths out of shared cache.
- Használd a WordPress presetet baselineként, majd adj hozzá site-specific bypassokat.
Jó illeszkedés
Ez a setup normál WordPress front controllerhez való, ahol a Fluxheim biztonságos static file-okat szolgál, blokkolja a PHP-t upload pathokban, és dynamic requesteket PHP-FPM-re továbbít.