I can't setup my Nginx. While php is working and i get the index.php served, all the calls to any other uri then "/index.php" are still looked up in the file system and not send to the index.php to get routed to their controller.
Here is my server config. I just took it from older comments here in the forum. The .nginx.conf that comes with Flarum s pretty unuseable when it doesn't even contain the things that are difficult (the FCGI integration).
server {
listen 80;
server_name forum.xn--microct-bxa.com;
root /home/{{microcat_user}}/forum/code/public;
index index.php index.html;
location / { try_files $uri $uri/ /index.php?$query_string; }
access_log /var/log/nginx/forum_access.log;
error_log /var/log/nginx/forum_error.log;
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php8.1-fpm.sock;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
}
Now i see in the access log files:
94.114.19.167 - - [08/Apr/2023:16:00:05 +0000] "GET /api/discussions?include=user%2ClastPostedUser&sort&page%5Boffset%5D=0 HTTP/1.1" 404 194 "http://forum.xn--microct-bxa.com/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.0.0 Safari/537.36"
191.97.38.205 - - [08/Apr/2023:16:01:32 +0000] "GET / HTTP/1.1" 200 5708 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Safari/537.36"
94.114.19.167 - - [08/Apr/2023:16:05:23 +0000] "GET / HTTP/1.1" 200 1784 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.0.0 Safari/537.36"
94.114.19.167 - - [08/Apr/2023:16:05:33 +0000] "POST /login HTTP/1.1" 404 194 "http://forum.xn--microct-bxa.com/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.0.0 Safari/537.36"
94.114.19.167 - - [08/Apr/2023:16:05:48 +0000] "GET /api/discussions?include=user%2ClastPostedUser&sort&page%5Boffset%5D=0 HTTP/1.1" 404 194 "http://forum.xn--microct-bxa.com/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.0.0 Safari/537.36"
And the error log:
2023/04/08 15:55:58 [error] 797279#797279: *200 open() "/home/llothar/forum/code/public/boaform/admin/formLogin" failed (2: No such file or directory), client: 117.195.87.77, server: forum.xn--microct-bxa.com, request: "GET /boaform/admin/formLogin?username=ec8&psd=ec8 HTTP/1.0"
2023/04/08 15:56:53 [error] 797279#797279: *204 open() "/home/llothar/forum/code/public/admin" failed (2: No such file or directory), client: 94.114.19.167, server: forum.xn--microct-bxa.com, request: "GET /admin HTTP/1.1", host: "forum.xn--microct-bxa.com"
2023/04/08 16:00:05 [error] 797279#797279: *211 open() "/home/llothar/forum/code/public/api/discussions" failed (2: No such file or directory), client: 94.114.19.167, server: forum.xn--microct-bxa.com, request: "GET /api/discussions?include=user%2ClastPostedUser&sort&page%5Boffset%5D=0 HTTP/1.1", host: "forum.xn--microct-bxa.com", referrer: "http://forum.xn--microct-bxa.com/"
2023/04/08 16:05:33 [error] 797279#797279: *218 open() "/home/llothar/forum/code/public/login" failed (2: No such file or directory), client: 94.114.19.167, server: forum.xn--microct-bxa.com, request: "POST /login HTTP/1.1", host: "forum.xn--microct-bxa.com", referrer: "http://forum.xn--microct-bxa.com/"
2023/04/08 16:05:48 [error] 797279#797279: *218 open() "/home/llothar/forum/code/public/api/discussions" failed (2: No such file or directory), client: 94.114.19.167, server: forum.xn--microct-bxa.com, request: "GET /api/discussions?include=user%2ClastPostedUser&sort&page%5Boffset%5D=0 HTTP/1.1", host: "forum.xn--microct-bxa.com", referrer: "http://forum.xn--microct-bxa.com/"
What is the rewrite rule i can add?