【发布时间】:2017-07-23 10:54:46
【问题描述】:
对我的服务器的访问应该仅限于某些远程主机,并且我想允许 Uptimerobot 监控我的服务器。
目前 uptimerobot 总是被 403 禁止。
我添加的 Server.xml 看起来是这样的:
<Server .........>
<Service name="Catalina">
<Engine>
<Value className="org.apache.catalina.valves.RemoteHostValve" allow=".*\.uptimerobot\.com" />
</Engine>
</Service>
匹配此列表中的所有主机UptimeRobot Whitelist
但重启服务器后没有任何变化,仍然是 403。
我也尝试过使用不带通配符的域名,如下所示:
allow="engine19\.uptimerobot\.com"
allow="engine19.uptimerobot.com"
但还是 403,
我尝试通过添加来启用主机名查找
enableLookups="true"
到<Connector
标记,但同样没有效果。
但在我的日志中,我看到访问被解析为“engine19.uptimerobot.com”,这与我的 RemoteHost-Pattern 匹配。
任何想法,为什么它仍然被禁止?
编辑:
通过IP访问
<Valve className="org.apache.catalina.valves.RemoteAddrValve" allow="63\.143\.42\.244"/>
正在工作。但我不想在那里添加整个 ips 列表。
RemoteAddrValve和RemoteHostValve会不会互相打扰?
【问题讨论】:
-
你能告诉我你是如何解决这个问题的吗?因为我面临同样的问题。
-
Unfurtunally 我还没有找到任何解决这个问题的方法:(
标签: tomcat8 remote-host