New install - ubuntu 20.04, nginx - 404 Not Found

I just installed the latest Grav on nginx on Ubuntu 20.04 based on a tutorial at How to Setup Grav CMS with Nginx on Ubuntu Linux - Geek Rewind

The tutorial installs several php 7.2 packages, but I changed them to 7.4. Also, I used a different address to get the grav package. I used https://getgrav.org/download/core/grav-admin/latest .

When I went to my url (rpallen.com.br) I got a “bad gateway” error. After some research I discovered that the config file in the sites-available directory referred to php 7-2. After changing this to 7.4, the “bad gateway” error went away. In the URL address bar of the browser, I enter just rpallen.com.br. The browser then goes to rpallen.com.br/admin and displays a page: 404 Not Found (nginx/1.18.0 (Ubuntu)).

Below is:
the code in the config file (/etc/nginx/sites-available/grav )
a listing of the webroot contents of /var/www/html/grav
a list of changes I made to the php.ini file

CONFIG FILE:

server {
listen 80;
listen [::]:80;
root /var/www/html/grav;
index index.php index.html index.htm;
server_name rpallen.com.br www.rpallen.com.br;

 client_max_body_size 1024M;

location / {
    try_files $uri $uri/ /grav/index.php?_url=$uri&$query_string;
}

location ~ \.php$ {
     include snippets/fastcgi-php.conf;
     fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
     fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
     include fastcgi_params;
}

listen [::]:443 ssl ipv6only=on; # managed by Certbot
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/rpallen.com.br/fullchain.pem; # manag>
ssl_certificate_key /etc/letsencrypt/live/rpallen.com.br/privkey.pem; # man>
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot

}

WEBROOT CONTENTS:

root@encontro:/var/www/html/grav# ls -l
total 460
drwxr-xr-x 2 www-data www-data 4096 Dec 4 14:02 assets
drwxr-xr-x 2 www-data www-data 4096 Dec 4 14:02 backup
drwxr-xr-x 2 www-data www-data 4096 Dec 4 14:02 bin
drwxr-xr-x 4 www-data www-data 4096 Dec 10 11:41 cache
-rwxr-xr-x 1 www-data www-data 145285 Dec 4 14:02 CHANGELOG.md
-rwxr-xr-x 1 www-data www-data 3216 Dec 4 14:02 CODE_OF_CONDUCT.md
-rwxr-xr-x 1 www-data www-data 3752 Dec 4 14:02 composer.json
-rwxr-xr-x 1 www-data www-data 231900 Dec 4 14:02 composer.lock
-rwxr-xr-x 1 www-data www-data 7098 Dec 4 14:02 CONTRIBUTING.md
drwxr-xr-x 2 www-data www-data 4096 Dec 4 14:02 images
-rwxr-xr-x 1 www-data www-data 1710 Dec 4 14:02 index.php
-rwxr-xr-x 1 www-data www-data 1071 Dec 4 14:02 LICENSE.txt
drwxr-xr-x 2 www-data www-data 4096 Dec 4 14:02 logs
-rwxr-xr-x 1 www-data www-data 76 Dec 4 14:02 now.json
-rwxr-xr-x 1 www-data www-data 6701 Dec 4 14:02 README.md
-rwxr-xr-x 1 www-data www-data 227 Dec 4 14:02 robots.txt
-rwxr-xr-x 1 www-data www-data 460 Dec 4 14:02 SECURITY.md
drwxr-xr-x 10 www-data www-data 4096 Dec 4 14:02 system
drwxr-xr-x 2 www-data www-data 4096 Dec 4 14:02 tmp
drwxr-xr-x 8 www-data www-data 4096 Dec 4 14:02 user
drwxr-xr-x 28 www-data www-data 4096 Dec 4 14:02 vendor
drwxr-xr-x 2 www-data www-data 4096 Dec 4 14:02 webserver-configs

CHANGES TO php.ini FILE:

sudo nano /etc/php/7.4/fpm/php.ini

file_uploads = On
allow_url_fopen = On
memory_limit = 512M
upload_max_filesize = 1024M
max_execution_time = 360
cgi.fix_pathinfo = 0
date.timezone = America/Bahia

I am not sure if this would help. But in my nginx config, I have the following and it works fine.

    location / {
            try_files $uri @gravcms;
    }

    location @gravcms {
            rewrite ^/(.*)$ /index.php?_url=$1 break;
            include fastcgi_params;
    }

I have all fastcgi parameters including fastcgi_pass inside fastcgi_params.

Edited:
Include information about fastcgi parameters

Thanks, _anto. Though I appreciate your reply, I waited more than 12 hours for a reply and I just can’t wait that long for a reply to something as basic as installation. I used grav a year or two ago and didn’t have a problem installing it. I don’t know why it is a problem now, but, again, I can’t wait an entire work day for solving a simple installation. Consequently, I’ve already abandoned my attempt to use grav and will use something else.

I am sorry that I cannot fulfil the Support Service Level Agreement, as I just joined this forum a few minutes before I posted my suggestion to fix your problem. :rofl:

_anto, my reply was in no way a criticism of you. It is a recognition of the reality that an entire workday passed with no response to a simple request about a failed installation. I recognize that grav is an open source project so my abandoning grav is not a criticism, but rather an acceptance that the nature of the grav project is incompatible with my needs.