Tomcat Valve settings

前端 未结 4 1535
名媛妹妹
名媛妹妹 2020-12-06 12:45

I\'m stuck with sort of a configuration issue I think. I need to protect a folder which is within my actual tomcat application from access from a certain IP range.

I

4条回答
  •  盖世英雄少女心
    2020-12-06 13:27

    Had the same need as you (but for other reasons) last week and created a valve to block requests by path. It's based off of org.apache.catalina.valves.RequestFilterValve.

    Usage:

    The valve can be used in Engine, Host or Context just as any valve and is available on GitHub. http://github.com/xlson/tomcat-valves

    I would suggest using the default tomcat valves or servlet filters in your application if that solves your problem. The reason we needed a custom valve was that some parts of the tomcat management application Psi-Probe would "leak out" even though we used the RemoteAddrValve in the element of the application.

提交回复
热议问题