Here, the Flarum installation folder is not in: /var/www/forum.example.com. It is in: /home/user/sites/flarum-site. The following error, which appears in the nginx error logs, happens 100% of the time.: "location" directive is not allowed here in... Thus, the Flarum installation instructions, located at the following are in fact broken and totally incorrect. https://flarum.org/docs/install.html#installing
In the Flarum installation instructions it clearly states:
include /path/to/flarum/.nginx.conf;
However, this is false, incorrect, and broken, because nginx gives the above error when the path, in this case, /home/user/sites/flarum-site is used:
Include statement added to /etc/nginx/sites-enabled/flarum-site.conf: include /home/user/sites/flarum-site/.nginx.conf;