Okay, so I'm coming over from the centminmod LEMP stack system, so composer and a lot of this is unfamiliar territory for me. I'm really struggling to get a working flarum install going in my LEMP server using the official documentation.
the server directory of my public folder before installing flarum is:
/home/nginx/domains/beta.squattheplanet.com/public
my nginx conf file is located at:
/usr/local/nginx/conf/conf.d/beta.squattheplanet.com.ssl.conf
the contents of that file:
#x# HTTPS-DEFAULT
server {
listen 80;
#x# listen [::]:80;
server_name beta.squattheplanet.com www.beta.squattheplanet.com;
return 302 https://beta.squattheplanet.com$request_uri;
root /home/nginx/domains/beta.squattheplanet.com/public;
include /usr/local/nginx/conf/staticfiles.conf;
}
server {
listen 443 ssl http2;
server_name beta.squattheplanet.com www.beta.squattheplanet.com;
include /usr/local/nginx/conf/ssl/beta.squattheplanet.com/beta.squattheplanet.com.crt.key.conf;
include /usr/local/nginx/conf/ssl_include.conf;
# cloudflare authenticated origin pull cert community.centminmod.com/threads/13847/
#ssl_client_certificate /usr/local/nginx/conf/ssl/cloudflare/beta.squattheplanet.com/origin.crt;
#ssl_verify_client on;
# mozilla recommended
ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES256-SHA:ECDHE-ECDSA-DES-CBC3-SHA:ECDHE-RSA-DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:DES-CBC3-SHA:!DSS;
ssl_prefer_server_ciphers on;
#add_header Alternate-Protocol 443:npn-spdy/3;
# before enabling HSTS line below read centminmod.com/nginx_domain_dns_setup.html#hsts
#add_header Strict-Transport-Security "max-age=31536000; includeSubdomains;";
#add_header X-Frame-Options SAMEORIGIN;
add_header X-Xss-Protection "1; mode=block" always;
add_header X-Content-Type-Options "nosniff" always;
#add_header Referrer-Policy "strict-origin-when-cross-origin";
#add_header Permissions-Policy "accelerometer=(), camera=(), geolocation=(), gyroscope=(), magnetometer=(), microphone=(), payment=(), usb=()";
#spdy_headers_comp 5;
ssl_buffer_size 1369;
ssl_session_tickets on;
# enable ocsp stapling
resolver 8.8.8.8 8.8.4.4 1.1.1.1 1.0.0.1 valid=10m;
resolver_timeout 10s;
ssl_stapling on;
ssl_stapling_verify on;
# ngx_pagespeed & ngx_pagespeed handler
#include /usr/local/nginx/conf/pagespeed.conf;
#include /usr/local/nginx/conf/pagespeedhandler.conf;
#include /usr/local/nginx/conf/pagespeedstatslog.conf;
# limit_conn limit_per_ip 16;
# ssi on;
access_log /home/nginx/domains/beta.squattheplanet.com/log/access.log combined buffer=256k flush=5m;
error_log /home/nginx/domains/beta.squattheplanet.com/log/error.log;
include /usr/local/nginx/conf/autoprotect/beta.squattheplanet.com/autoprotect-beta.squattheplanet.com.conf;
root /home/nginx/domains/beta.squattheplanet.com/public;
# uncomment cloudflare.conf include if using cloudflare for
# server and/or vhost site
include /usr/local/nginx/conf/cloudflare.conf;
include /usr/local/nginx/conf/503include-main.conf;
location / {
include /usr/local/nginx/conf/503include-only.conf;
# block common exploits, sql injections etc
#include /usr/local/nginx/conf/block.conf;
# Enables directory listings when index file not found
#autoindex on;
# Shows file listing times as local time
#autoindex_localtime on;
# Wordpress Permalinks example
#try_files $uri $uri/ /index.php?q=$uri&$args;
}
include /usr/local/nginx/conf/php.conf;
include /usr/local/nginx/conf/pre-staticfiles-local-beta.squattheplanet.com.conf;
include /usr/local/nginx/conf/pre-staticfiles-global.conf;
include /usr/local/nginx/conf/staticfiles.conf;
include /usr/local/nginx/conf/drop.conf;
#include /usr/local/nginx/conf/errorpage.conf;
include /usr/local/nginx/conf/vts_server.conf;
include /home/nginx/domains/beta.squattheplanet.com/public/.nginx.conf;
}
by default, this install results in beta.squattheplanet.com/public for a URL, and /home/nginx/domains/beta.squattheplanet.com/public/public for a server directory, so I followed the instructions for customizing paths:
$site = require './site.php';
'base' => __DIR__,
'public' => __DIR__,
'storage' => __DIR__.'/storage',
i uncommented lines 8-11 of the nginx.conf.
I ran the install, used the flarum_ table prefix, and all seems well, until I click on a tag, then I get the 'The requested resource was not found' error.
Turning on debug in config.php, I get:
GET https://beta.squattheplanet.com/api/tags/general
<html>
<head><title>404 Not Found</title><script src="/cdn-cgi/apps/head/0IuqbACX7hAbYIIEPmwItu71Tss.js"></script></head>
<body>
<center><h1>404 Not Found</h1></center>
<hr><center>nginx</center>
</body>
</html>
I don't have an api or cdn-cgi folder in my public directory.
The only other thing I can think of is that I did install flarum using composer as root. I understand this is frowned upon, but it's just for testing purposes while I figure out the installation and migration of my community to flarum.
I'm really not sure what to do at this point, so any help would be appreciated.