get error bad gateway when trying to build flarum forum website

i am a learner at building personal website ,and i learn about nginx and just uploading my website ,but i have some trouble at building the flarum forum siteļ¼
i have follow several instruction and install the mysql composer and php

and i install the flarum and write the config blow
server {
listen 80;
listen [::]:80;
root /var/www/flarum/public;
index index.php index.html index.htm;
server_name example.com;
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php7.4-fpm.sock;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
location ~ /\. {
deny all;
}
location = /favicon.ico {
log_not_found off;
access_log off;
}
location = /robots.txt {
log_not_found off;
access_log off;
access_log off;
}
location = /robots.txt {
log_not_found off;
access_log off;
allow all;
}
}
there is some trouble with the flarum and i get the error bad gateway


