Below is how to fix the Your web server is not properly set up to resolve /.well-known/webfinger /.well-known/nodeinfo error if using NGiNX since everything else I could find was for Apache/HTTPD.

Add the following to your NGiNX config file for nextcloud. Usualy found in /etc/nginx/sites-enabled/ or /etc/nginx/conf.d/

   location = /.well-known/webfinger {
      return 301 $scheme://$host/index.php/.well-known/webfinger;
   location = /.well-known/nodeinfo {
      return 301 $scheme://$host/index.php/.well-known/nodeinfo;

ACPu errors when doing stuff on the command line.

By default ACPu is not enabled/used on the CLI for some reason. To use ACPu you can specify it by the following

sudo -u www-data /usr/bin/php7.3 --define apc.enable_cli=1 ./occ command:here