禁止互联网用户访问 tomcat 的 index.jsp

Disallow access to tomcat's index.jsp to internet users

我不希望互联网用户访问 tomcats index.jsp。

假设我有一个域,因为 https://www.example.org. Then using https://www.example.org/index.jsp 也会向互联网用户显示 tomcats 管理器。

如何预防?

您可以使用 Tomcat's 远程地址过滤器来实现。

修改$CATALINA_HOME/conf/Catalina/localhost/manager.xml.

像这样添加过滤器:

<Context
    path="/manager"
    docBase="${catalina.home}/server/webapps"
    privileged="true">
    <Valve className="org.apache.catalina.valves.RemoteAddrValve"
      allow="127\.0\.0\.1"
    />
</Context>

这将只允许本地主机地址访问管理器应用程序。