Apache2 / Laravel отвечает 301 на некоторых агентах - PullRequest
0 голосов
/ 20 мая 2019

У меня установлен wifidog на TP-LINK (openwrt 18.06.2)

У меня установлен wifidog-auth-laravel на OVH Debian github / wifidog / wifidog-auth-laravel)

Если я использую curl, chrome и wget; Я получаю ответ на понг для URL аутентификации

Но если wifidog попытается получить ответ от понга, я получу ответ 301 Постоянно перемещенный.

Как это может быть?

[7][Mon May 20 13:44:54 2019][5977](centralserver.c:302) Level 1: Connecting to auth server example.com:80
[7][Mon May 20 13:44:54 2019][5977](centralserver.c:331) Level 1: Successfully connected to auth server example.com:80
[7][Mon May 20 13:44:54 2019][5977](centralserver.c:141) Unlocking config
[7][Mon May 20 13:44:54 2019][5977](centralserver.c:141) Config unlocked
[7][Mon May 20 13:44:54 2019][5977](centralserver.c:147) Connected to auth server
[6][Mon May 20 13:44:54 2019][5977](wd_util.c:116) AUTH_ONLINE status became ON
[7][Mon May 20 13:44:54 2019][5977](simple_http.c:77) Sending HTTP request to auth server: [GET /ping/?gw_id=EC086B35444C&sys_uptime=1820&sys_memfree=6096&sys_load=0.70&wifidog_uptime=3 HTTP/1.0
User-Agent: WiFiDog 1.2.1
Host: example.com

]

[7][Mon May 20 13:44:54 2019][5977](simple_http.c:87) Reading response
[7][Mon May 20 13:44:54 2019][5977](simple_http.c:111) Read 725 bytes
[7][Mon May 20 13:44:54 2019][5977](simple_http.c:124) HTTP Response from 

Server: [HTTP/1.1 301 Moved Permanently
Date: Mon, 20 May 2019 13:44:54 GMT
Server: Apache/2.4.25 (Debian)
Location: http://example.com/ping?gw_id=EC086B35444C&sys_uptime=1820&sys_memfree=6096&sys_load=0.70&wifidog_uptime=3
Content-Length: 415
Connection: close
Content-Type: text/html; charset=iso-8859-1

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>301 Moved Permanently</title>
</head><body>
<h1>Moved Permanently</h1>
<p>The document has moved <a href="http://example.com/ping?gw_id=EC086B35444C&amp;sys_uptime=1820&amp;sys_memfree=6096&amp;sys_load=0.70&amp;wifidog_uptime=3">here</a>.</p>
<hr>
<address>Apache/2.4.25 (Debian) Server at example.com Port 80</address>
</body></html>
]
[4][Mon May 20 13:44:54 2019][5977](ping_thread.c:191) Auth server did NOT say Pong!
[7][Mon May 20 13:44:54 2019][5977](firewall.c:140) Marking auth server down

1 Ответ

0 голосов
/ 20 мая 2019

Я нашел решение: пользовательский агент Wifidog сформировал URL, отличный от других пользовательских агентов:

Обходной путь находится в файле wifidog.conf

AuthServer {
    Hostname example.com
    SSLAvailable yes
    Path /
    PingScriptPathFragment ping?
    LoginScriptPathFragment login?
    PortalScriptPathFragment portal?
    MsgScriptPathFragment gw_message.php?
    AuthScriptPathFragment auth?
}
...