如何限制使用Apache访问特定的URI

我有Apache运行在一个Web应用程序的基本URL将是http://myapp:8080/myApp/ ,代理http://example.com/ 。 该URL后面有几个资源应该被IP限制。 我在网上find的解决scheme的问题是,它们似乎是任何以下URI的一揽子限制。

例如,我有: http://example.com/search : http://example.com/searchhttp://example.com/secret

我希望每个人都能够访问/search URI,但只允许访问所有其他的URIpath到指定的IP。 我面临的问题是试图拒绝访问其他 URI,无论它们是什么。

事实certificate,我是在过度复杂的问题。

这工作在我想要的方式:

 <VirtualHost *:80> ProxyPass /myApp http://localhost:8080/myApp ProxyPassReverse /myApp http://localhost:8080/myApp <Location /myApp> deny from all Order deny,allow allow from ip1 ip2 ip3 </Location> <Location /myApp/search> Order allow,deny allow from all </Location> </VirtualHost> 

默认情况下,这是禁止访问/myApp下的每个位置,但允许访问/myApp/search 。 现在只是允许特定IP的情况。 我已经添加到我的答案完整性。