Nextcloud web interface didn't load after upgrade to Nextcloud 12

I want to mention a couple things for reference:

  1. It’s not recommended to set 777 for permissions. The recommendation is 750 for directories, and 640 for files. The owner and group should be the http user (www-data, etc)
  2. Apparently Nextcloud automatically resets the data directory permissions when you restart the web server, to 770
    Nextcloud "data" directory permissions resetting to 770