FastAdmin 安裝后點登錄沒有反應怎么辦?
很多小伙伴安裝后點“登錄”沒有反應。
這個 URL 是對的,但是頁面就是不改變。
如果這時候點擊 URL 變了,那沒有到登陸界面,一般是 URL 重寫問題。
一般如果是 Apache 服務器,FastAdmin 是有默認的重寫規則。
一般這個問題出現在 NGINX 的服務器上,需要對 NGINX 的重寫進行配置。
server {
listen 80;
server_name www.fa.com *.fa.com;
root "C:/phpstudy/WWW/fastadmin/public";
location / {
index index.html index.htm index.php;
#主要是這一段一定要確保存在
if (!-e $request_filename) {
rewrite ^(.*)$ /index.php?s=/$1 last;
break;
}
#結束
#autoindex on;
}
location ~ \.php(.*)$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_split_path_info ^((?U).+\.php)(/?.+)$;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
include fastcgi_params;
}
}
這個問題在 FastAdmin 官方文檔中的 FAQ 有寫。