server { listen 8081; server_name _; root /app/www/public; index index.php index.html; access_log /dev/stdout; error_log /dev/stderr; location / { try_files $uri $uri/ /index.php?$args; } location ~ \.php$ { fastcgi_pass unix:/run/php/php8.2-fpm.sock; fastcgi_index index.php; include fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; # Extract original URI (without query string) from REQUEST_URI if ($request_uri ~ ^([^?]*)) { set $orig_path $1; } fastcgi_param ORIG_PATH_INFO $orig_path; } location ~ /\.(ht|env|git) { deny all; } }