When should I use this fastcgi-php.conf?
Use it to restore a missing default, confirm what shipped, or diff against your current NGINX config.
# regex to split $uri to $fastcgi_script_name and $fastcgi_path fastcgi_split_path_info ^(.+\.php)(/.+)$; # Check that the PHP script exists before passing it try_files $fastcgi_script_name =404; # Bypass the fact that try_files resets $fastcgi_path_info # see: http://trac.nginx.org/nginx/ticket/321 set $path_info $fastcgi_path_info; fastcgi_param PATH_INFO $path_info; fastcgi_index index.php; include fastcgi.conf;
curl https://exampleconfig.com/api/v1/config/original/678c2236edfebe41de06c26fb378e9a0?hint=fastcgi-php.conf
wget -O fastcgi-php.conf https://exampleconfig.com/api/v1/config/original/678c2236edfebe41de06c26fb378e9a0?hint=fastcgi-php.conf
<prompt><role>DevOps agent</role><source url='https://exampleconfig.com/api/v1/config/original/678c2236edfebe41de06c26fb378e9a0?hint=fastcgi-php.conf' /><config><app>NGINX</app><os>Ubuntu 18.04 LTS (Bionic Beaver)</os><location>/etc/nginx/snippets/fastcgi-php.conf</location><lines>13</lines><md5>678c2236edfebe41de06c26fb378e9a0</md5><sha256>973ee254513b609fd9ec80572befa147d841a6fed622bdd5656037811f15bc5d</sha256></config></prompt>
Paste into Claude, ChatGPT, or any AI assistant.
sudo apk add nginx
sudo apt update && sudo apt install nginx
sudo yum install nginx
sudo apt update && sudo apt install nginx
When should I use this fastcgi-php.conf?
Use it to restore a missing default, confirm what shipped, or diff against your current NGINX config.
How do I restore NGINX defaults?
Download the file, back up the current one in /etc/nginx/snippets/fastcgi-php.conf, replace it, then reload or restart NGINX.
Is fastcgi-php.conf safe for production?
It is the vendor default for Ubuntu 18.04 LTS (Bionic Beaver). Treat it as a baseline and review security and performance settings before production use.
How does this differ from other OS versions?
Defaults vary by distro and version. This copy matches Ubuntu 18.04 LTS (Bionic Beaver).
Can I use this for NGINX troubleshooting?
Yes. Diff it against yours to find drift, then restore only the sections you need.