I'm new to flarum so I installed flarum with the guide of this post. I followed its guide and it quite helps me a lot, I installed it successfully by edge browser. However when I wanted to publish a post I failed, I enter f12 to see the details, it said that the /api/disscussion is 404. I knew this is caused by nginx reverse-proxy, so I check my nginx config file and found the following key port:
server {
listen 80;
server_name hustport.pivotstudio.cn;
root /Flarum/public;
index index.php index.html index.htm;
location / { try_files $uri $uri/ /index.php?$query_string; }
location /api { try_files $uri $uri/ /api.php?$query_string; }
location /admin { try_files $uri $uri/ /admin.php?$query_string; }
I found location /api { try_files $uri $uri/ /api.php?$query_string; } means that when a request comes in, nginx will find api.php with query_string to deal with this request and then give a response back. But I found my public folder doesn't contain a file named api.php, neither an admin.php. I'm very confused for why I lost those two significant php file.