I'm currently learning Nginx, and trying to get phpinfo to be displayed.
But it only displays a blank page like this.

The below is what I have made sure / tried so far.
find / -name *fpm.sock
/run/php/php7.4-fpm.sock
root@nginx-fundamentals:/sites/demo# cat info.php
<?php phpinfo(); ?>
root@nginx-fundamentals:~# ps aux | grep nginx
root 1056 0.0 0.3 8720 3212 ? Ss Jun20 0:00 nginx: master process /usr/sbin/nginx
www-data 104677 0.0 0.3 9140 3684 ? S Jul06 0:00 nginx: worker process
root 112008 0.0 0.2 8160 2496 pts/0 S+ 04:03 0:00 grep --color=auto nginx
root@nginx-fundamentals:~# ps aux | grep php
root 11018 0.0 1.0 195484 10496 ? Ss Jun21 1:52 php-fpm: master process (/etc/php/7.4/fpm/php-fpm.conf)
www-data 11020 0.0 0.4 195872 4756 ? S Jun21 0:00 php-fpm: pool www
www-data 11021 0.0 0.4 195872 4756 ? S Jun21 0:00 php-fpm: pool www
root 112010 0.0 0.0 8160 736 pts/0 S+ 04:03 0:00 grep --color=auto php
root@nginx-fundamentals:/etc/nginx# cat nginx.conf
user www-data;
events {}
http {
include mime.types;
server {
listen 80;
server_name XX.XXX.XXX.117;
root /sites/demo;
index index.php index.html;
location / {
try_files $uri $uri/ =404;
}
location ~\.phps$ {
# Pass php requests to the php-fps service (fastcgi)
include fastcgi.conf;
fastcgi_pass unix:/run/php/php7.4-fpm.sock;
}
}
}
What am I doing wrong? What else should I investigate?