server { listen 80; server_name example.com; root /var/www/example.com/web; index index.php index.htm index.html; location ~ \.php$ { include snippets/fastcgi-php.conf; fastcgi_pass unix:/run/php/php8.4-fpm.sock; } # Prevent PHP scripts from being executed inside the uploads folder. location ~* /app/uploads/.*.php$ { deny all; } location / { try_files $uri $uri/ /index.php?$args; } }