nginx downloading php file code example
Example: php file download instead of executing nginx
server {
server_name my-domain.com;
root /usr/share/nginx/html;
location = favicon.ico { access_log off; log_not_found off; }
index index.php;
location / {
try_files $uri $uri/ =404;
}
location ~ \.php$ {
fastcgi_pass unix:/run/php-fpm/www.sock;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}