管理后台登录时,ERR_TOO_MANY_REDIRECTS
totemtec opened this issue · 3 comments
一直不停的redirect
wget http://127.0.0.1:8000/admin
--2021-03-12 12:13:46-- http://127.0.0.1:8000/admin
Connecting to 127.0.0.1:8000... connected.
HTTP request sent, awaiting response... 302 Found
Location: http://127.0.0.1:8000/admin/auth/login [following]
--2021-03-12 12:13:46-- http://127.0.0.1:8000/admin/auth/login
Connecting to 127.0.0.1:8000... connected.
HTTP request sent, awaiting response... 302 Found
Location: http://127.0.0.1:8000/admin/auth/login [following]
--2021-03-12 12:13:46-- http://127.0.0.1:8000/admin/auth/login
Connecting to 127.0.0.1:8000... connected.
HTTP request sent, awaiting response... 302 Found
Location: http://127.0.0.1:8000/admin/auth/login [following]
--2021-03-12 12:13:46-- http://127.0.0.1:8000/admin/auth/login
Connecting to 127.0.0.1:8000... connected.
HTTP request sent, awaiting response... 302 Found
Location: http://127.0.0.1:8000/admin/auth/login [following]
--2021-03-12 12:13:46-- http://127.0.0.1:8000/admin/auth/login
PHP7.4 日志没有报错
Nginx日志也没错误
+1,我的也是管理界面一直302进不去,提示重定向次数过多,首页可以正常访问。
看到有大佬解决了:https://www.daniao.org/13006.html
修复后台登录页面无限重定向,在根目录找到文件:config/admin.php
添加如下代码:
'auth'=>[
...
'excepts'=>[
'auth/login',
]
],
一下是编辑后大概的样子如下:
'auth' => [
'controller' => App\Admin\Controllers\AuthController::class,
'guards' => [
'admin' => [
'driver' => 'session',
'provider' => 'admin',
],
],
'excepts'=>[
'auth/login',
],
'providers' => [
'admin' => [
'driver' => 'eloquent',
'model' => Encore\Admin\Auth\Database\Administrator::class,
],
],
],
/*