Running PHP behind Nginx with PHP-FPM is the standard production setup for WordPress, Laravel, and Symfony apps. Our generator wires up fastcgi_pass correctly so you can focus on your application.
Route .php requests to the FPM socket with fastcgi_pass and include fastcgi_params. Use a location that only matches real PHP entry points.
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php8.4-fpm.sock;
}WordPress, Laravel, Symfony and Drupal each need a different front-controller rule. The generator ships presets so you do not expose stray PHP files or uploads directories that can execute code.
A Unix socket is faster and avoids opening a port; use TCP only when FPM runs on another host or in a container.
Usually the socket path in fastcgi_pass does not match the pool, or the nginx user is not allowed to connect to it. Check the FPM pool listen and listen.owner settings.