Internal Server Error // connect() failed (111: Connection refused)

[/details]

Nextcloud version (eg, 20.0.5): 25.0.2
Operating system and version (eg, Ubuntu 20.04): Debian 11
Apache or nginx version (eg, Apache 2.4.25): 1.18.0
PHP version (eg, 7.4): 7.4

The issue you are facing: When I enter the domain into my browser I receive and Internal Sever Error. When I look at the logs I come across this error.

2023/01/14 23:34:12 [error] 1184565#1184565: *48 connect() failed (111: Connection refused) while connecting to upstream, client: 95.217.53.149, server: nextcloud.4libertas.com, request: "GET /owncloud/status.php HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "nextcloud.4libertas.com"

Is this the first time you’ve seen this error? (Y/N): Y

I tried following this - https://stackoverflow.com/questions/21524373/nginx-connect-failed-111-connection-refused-while-connecting-to-upstream - but a new error then appeared

2023/01/14 23:09:16 [crit] 1184280#1184280: *1 connect() to unix:/var/run/php/php7.4-fpm.sock failed (2: No such file or directory) while connecting to upstream, client: 81.92.205.28, server: nextcloud.4libertas.com, request: "GET / HTTP/2.0", upstream: "fastcgi://unix:/var/run/php/php7.4-fpm.sock:", host: "nextcloud.4libertas.com"