server {
listen 80;
server_name flarum.local;
root /vagrant/app/flarum/;
index index.htm index.html index.php;
location /api {
try_files $uri $uri/ /api.php?$query_string;
}
location /admin {
try_files $uri $uri/ /admin.php?$query_string;
}
location / {
index index.php index.html index.htm;
try_files $uri @rewrite;
}
location @rewrite {
rewrite ^ /index.php;
}
location ~ .php{
fastcgi_pass 127.0.0.1:9000;
fastcgi_split_path_info ^(.+.php)(/.+)$;
# fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
include fastcgi.conf;
}
}
需要自己手动添加index.php
但是添加之后无法访问asset,控制台报错。
Failed to load resource: the server responded with a status of 500 (Internal Server Error)
http://flarum.local/index.php/assets/forum-j87rYF0XBW31CagO.css
index.php:91 Uncaught ReferenceError: System is not defined