Flarum:/ admin为403错误,/ api为404错误

时间:2016-07-02 21:26:29

标签: php .htaccess nginx nginx-location

我已经为论坛安装了Flarum

我使用此路径http://rootUrl/support

访问Flarum

我可以注册/登录添加主题等...

但是当我尝试转到管理面板http://rootUrl/support/admin时,它会给我403错误,当我尝试点击http://rootUrl/support/api时,它会给我404错误。 (我多年来一直没有使用过PHP)

我使用的是nginx 1.8.1和php5.6。

服务器块上的nginx.conf:

location /support { 
    try_files $uri $uri/ /support/index.php?$query_string; 
}

location /support/api { 
    try_files $uri $uri/ /support/api.php?$query_string; 
}

location /support/admin { 
    try_files $uri $uri/ /support/admin.php?$query_string; 
}

location /flarum {
    deny all;
    return 404;
}

location ~* \.php$ {
    fastcgi_split_path_info ^(.+.php)(/.+)$;
    fastcgi_pass   127.0.0.1:9000;
    include fastcgi_params;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    fastcgi_index index.php;
}

和我的.htaccess文件:

<IfModule mod_rewrite.c>
  RewriteEngine on
  RewriteBase /support

  RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

  RewriteRule ^vendor/(.*)?$ / [F,L]
  RewriteRule ^storage/(.*)?$ / [F,L]
  RewriteRule ^config.php$ / [F,L]

  RewriteRule ^api(.*)$ api.php [QSA,L]
  RewriteRule ^admin(.*)$ admin.php [QSA,L]

  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule !^assets index.php [QSA,L]

  # MultiViews can mess up our rewriting scheme
  Options -MultiViews

  # Autoindex will list all assets files which is not so good
  Options -Indexes
</IfModule>

我还注意到我的.htaccess文件没有被读取。 (删除它没有任何改变)

我的conf有什么不对吗?

感谢。

0 个答案:

没有答案