简体   繁体   English

Apache2 / Laravel在某些代理上回复301

[英]Apache2/Laravel responding 301 on some agents

I have wifidog installed on a TP-LINK (openwrt 18.06.2) 我在TP-LINK上安装了wifidog(openwrt 18.06.2)

I have wifidog-auth-laravel installed on a OVH Debian github /wifidog/wifidog-auth-laravel) 我在OVH Debian github / wifidog / wifidog-auth-laravel上安装了wifidog-auth-laravel)

If I use curl, chrome and wget; 如果我使用curl,chrome和wget; I get the pong response for the authetication url 我得到了认证网址的pong响应

But if wifidog attempts to get the pong response I get a 301 Permanantly moved response. 但如果wifidog试图获得pong响应,我会得到301永久性的反应。

How can that be? 怎么可能?

[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

I found the solution: The Wifidog userAgent formed the url different from the other user agents: 我找到了解决方案:Wifidog userAgent形成了与其他用户代理不同的URL:

a workaround is in the wifidog.conf 解决方法是在wifidog.conf中

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM