server { listen 80; root /var/www/public; location / { index index.php index.html; if (!-e $request_filename) { rewrite ^(.*)$ /index.php?s=/$1 last; } } location ~ \.php(/|$) { include fastcgi_params; fastcgi_pass unix:/var/run/php/php8.2-fpm.sock; fastcgi_index index.php; fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; } }