When I include the nginx.conf file to my default nginx configuration, by adding the include line below, I get 502 gateway errors whenever I try to access anything on the server.
`
server {
listen 8080 default;
server_name sitename;
root /media/66bc/uname/www/$host/public_html/public;
index index.html index.php;
autoindex on;
autoindex_exact_size off;
autoindex_localtime on;
# Pass files that end in .php to PHP
location ~ \.php$ {
fastcgi_read_timeout 1h;
fastcgi_send_timeout 10m;
include /etc/nginx/fastcgi.conf;
fastcgi_pass unix:/media/66bc/uname/.nginx/php/socket;
}
include /media/66bc/uname/www/$host/public_html/.nginx.conf;
# Deny access to anything starting with .ht
location ~ /\.ht {
deny all;
}
include conf.d/000-default-server.d/*.conf;
}`
When I don't include it, Flarum loads but I can't do anything, as I get "resource not found" messages. The error.log for nginx gives errors like
2022/07/14 13:12:58 [error] 29511#29511: *27 open() "/media/66bc/uname/www/sitename/public_html/public/api/discussions" failed (2: No such file or directory), client: 185.21.216.160, server: sitename, request: "GET /api/discussions?include=user%2ClastPostedUser%2CfirstPost%2Ctags%2Ctags.parent&sort&page%5Boffset%5D=0 HTTP/1.0", host: "sitename", referrer: "http://sitename/"
when I don't include .nginx.conf and try to do something in Flarum, but when I do load the conf file so that I immediately get 502 gateway errors trying to load any page, no errors are posted to the log.
Also, when I don't load .nginx.conf, my PHP is working correctly, as I tested a hello-world php script.